結果

提出番号 169
提出者 C3H5(ONO2)3
言語 C++
提出日時 2017-07-03 22:59:15
問題名 (14)アルファベッター
結果 AC
点数 100%

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 AC 100% 1ms 7552KB
2 AC 100% 1ms 8096KB
3 AC 100% 55ms 8480KB
4 AC 100% 59ms 8464KB
5 AC 100% 55ms 8480KB
6 AC 100% 59ms 8464KB
7 AC 100% 60ms 8448KB

ソースコード

#include<iostream>
#include<algorithm>
#include<cassert>
#include<vector>
#include<fstream>
#include<string>
using namespace std;
#define f(n) for(int i=0;i<n;++i)

int main() {
	int n, ans;
	cin >> n;
	string s;
	cin >> s;
	for (int i = 0; i < 26; i++) {
		ans = 0;
		for (int j = 0; j < n; j++) {
			if (s[j] == char((int)'a'+i)) {
				ans++;
			}
		}
		cout << ans << " ";
	}
	cout << endl;
	return 0;
}