-
I - You can say 11
- UVA - 10929
- 注意string与字符的比较“ ”整体双引号,单个单引号‘’
-
#include<bits/stdc++.h> using namespace std; int main() { char str[1555]; int n,m; while(cin>>str) { if(strcmp(str,"0")==0) break; m=str[0]-'0'; int len=strlen(str); for(int i=1; i<len; i++) { n=str[i]-'0'+m*10; m=n%11; } if(m==0) cout<<str<<" is a multiple of 11."<<endl; else cout<<str<<" is not a multiple of 11."<<endl; } return 0; }
I - You can say 11 大数整除问题-
最新推荐文章于 2019-06-09 18:31:00 发布