- #include <iostream>
- #include <fstream>
- using namespace std;
- int main(void){
-
- fstream fin, fout;
- fin.open("pf.in",ios::in);
- fout.open("pf.out",ios::out);
-
- int n, x;
- int a, b, c, d, e, f, g;
- fin >> n;
- for(int i=0; i<=n; i++){
- fin >> x;
-
- while(x>=10){
- a = x/10000000;
- x = x%10000000;
- b = x/1000000;
- x = x%1000000;
- c = x/100000;
- x = x%100000;
- d = x/10000;
- x = x%10000;
- e = x/1000;
- x = x%1000;
- f = x/100;
- x = x%100;
- g = x/10;
- x = x%10;
- x = a+b+c+d+e+f+g+x;
- }
- fout << x <<", ";
- if(x==2){
- fout <<"Yes"<< endl;
- }else{
- fout <<"No"<< endl;
- }
- }
-
-
- fin.close();
- fout.close();
- }
複製代碼 超級爛方法 @@ |