Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: lumppengae
Problemset: อะนาแกรม 2
Language: cpp
Time: 0.004 second
Submitted On: 2026-09-30 14:06:23
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,
C#, OCaml, VB, Perl, Swift, Prolog, Javascript, Pascal, COBOL, HTML, CSS, JS
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <iostream>
using namespace std;
int main()
{
string a;
cin >>a;
int f=int('A'),d=int('H'),j=0;
int c[500]={0};
int l[500]={0};
for (int i=0;i<a.length();i++){
c[a[i]]++;
}
for (int i=f;i<=d;i++){
cout<<c[i]<<" ";
}
cout<<endl;
cin>>a;
for (int i=0;i<a.length();i++){
l[a[i]]++;
}
for (int i=f;i<=d;i++){
cout<<l[i]<<" ";
}
cout<<endl;
for (int i=f;i<=d;i++){
if(c[i]!=l[i]){
if(l[i]>c[i]){
cout<<l[i]-c[i];
j+=l[i]-c[i];
}else{
j+=c[i]-l[i];
cout<<c[i]-l[i];
}
}else{
cout<<0;
}
cout<<" ";
}
if(j<=3){
cout<<endl<<"anagram";
}else{
cout<<endl<<"no";
}
}