Xin chỉ giúp mình lỗi này với. cảm ơn !
code tìm lượng kí tự khác nhau trong xâu:
#include <bits/stdc++.h>
#define task "CHAR"
using namespace std;
string s;
long long a[1000],t=0;
int main()
{
#ifndef ONLINE_JUDGE
freopen(task".INP","r",stdin);
freopen(task".OUT","w",stdout);
#endif // ONLINE_JUDGE
memset(a,0,sizeof(a));
getline(cin,s);
for(int i=0; i<s.length(); i++)
{
if(a[s[i]]==0) t++;
a[s[i]]++;
}
cout<<t;
}
terminated with exit code: 3221225477
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?