- #include <bits/stdc++.h>
- using namespace std;
- int main(int argc, char** argv) {
- char a[100], b[100];
- int n, atotal, btotal;
- cin>>a>>b>>n;
- for(int i=0;i<=a[n];i++){
- atotal+=int(a[i]);
- }
- for(int i=0;i<=b[n];i++){
- btotal+=int(b[i]);
- }
- if(atotal=btotal){
- cout<<"atotal=btotal";
- }else if(atotal>btotal){
- cout<<"atotal>btotal";
- }else if(atotal<btotal){
- cout<<"atotal<btotal";
- }
-
- return 0;
- }
複製代碼 |