Language: C++

include<iostream>include<cstring>using namespace std;int main(){char c[1001];int ans;while(cin>>c){if(c[0]=='0') break;ans = 0;for(int i=0;i<strlen(c);i++) ans += c-'0';cout << ans << endl;}return 0;}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>include<cstring>using namespace std;int main(){char c[1001];int ans;while(cin>>c){if(c[0]=='0') break;ans = 0;for(int i=0;i<strlen(c);i++) ans += c-'0';cout << ans << endl;}return 0;}
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:1:92: error: 'cin' was not declared in this scope
    1 | include<iostream>include<cstring>using namespace std;int main(){char c[1001];int ans;while(cin>>c){if(c[0]=='0') break;ans = 0;for(int i=0;i<strlen(c);i++) ans += c-'0';cout << ans << endl;}return 0;}
      |                                                                                            ^~~
a.cc:1:142: error: 'strlen' was not declared in this scope
    1 | include<iostream>include<cstring>using namespace std;int main(){char c[1001];int ans;while(cin>>c){if(c[0]=='0') break;ans = 0;for(int i=0;i<strlen(c);i++) ans += c-'0';cout << ans << endl;}return 0;}
      |                                                                                                                                              ^~~~~~
a.cc:1:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | include<iostream>include<cstring>using namespace std;int main(){char c[1001];int ans;while(cin>>c){if(c[0]=='0') break;ans = 0;for(int i=0;i<strlen(c);i++) ans += c-'0';cout << ans << endl;}return 0;}
a.cc:1:161: error: invalid conversion from 'char*' to 'int' [-fpermissive]
    1 | include<iostream>include<cstring>using namespace std;int main(){char c[1001];int ans;while(cin>>c){if(c[0]=='0') break;ans = 0;for(int i=0;i<strlen(c);i++) ans += c-'0';cout << ans << endl;}return 0;}
      |                                                                                                                                                             ~~~~^~~~~~~~
      |                                                                                                                                                                 |
      |                                                                                                                                                                 char*
a.cc:1:170: error: 'cout' was not declared in this scope
    1 | include<iostream>include<cstring>using namespace std;int main(){char c[1001];int ans;while(cin>>c){if(c[0]=='0') break;ans = 0;for(int i=0;i<strlen(c);i++) ans += c-'0';cout << ans << endl;}return 0;}
      |                                                                                                                                                                          ^~~~
a.cc:1:185: error: 'endl' was not declared in this scope
    1 | include<iostream>include<cstring>using namespace std;int main(){char c[1001];int ans;while(cin>>c){if(c[0]=='0') break;ans = 0;for(int i=0;i<strlen(c);i++) ans += c-'0';cout << ans << endl;}return 0;}
      |                                                                                                                                                                                         ^~~~