Advertisement
Farjana_akter

Untitled

Feb 1st, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. char a[1000],b[1000];
  7. int t,i,j,k,l;
  8. cin>>t;
  9. getchar();
  10. for(i=1;i<=t;i++)
  11. {
  12. scanf("%[^\n]\n",a);
  13. scanf("%[^\n]\n",b);
  14. int sum1=0,sum2=0;
  15. for(j=0;a[j]!='\0';j++)
  16. {
  17. if(a[j]==' ')
  18. continue;
  19. else
  20. {
  21. a[j]=toupper(a[j]);
  22. sum1+=a[j];
  23. }
  24. }
  25. for(j=0;b[j]!='\0';j++)
  26. {
  27. if(b[j]==' ')
  28. continue;
  29. else
  30. {
  31. b[j]=toupper(b[j]);
  32. sum2+=b[j];
  33. }
  34. }
  35. if(sum1==sum2)
  36. printf("Case %d: Yes\n",i);
  37. else
  38. printf("Case %d: No\n",i);
  39.  
  40. }
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement