社区讨论
在红题前倒下了,大佬们扶扶我
UVA10929You can say 11参与者 3已保存回复 7
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 7 条
- 当前快照
- 1 份
- 快照标识符
- @mi7ddvag
- 此快照首次捕获于
- 2025/11/20 19:50 4 个月前
- 此快照最后确认于
- 2025/11/20 19:50 4 个月前
CPP
#include<cstdio>
#include<cstring>
using namespace std;
int a[1100],len=0,x=0;
char st[1100];
int main()
{
while(1)
{
scanf("%s",st+1);
if(st[1]=='0')return 0;
len=strlen(st+1);
for(int i=1;i<=len;i++)a[i]=st[i]-'0';
for(int i=1;i<=len;i++)x=(x*10+a[i])%11;
if(x==0)printf("%s is a multiple of 11.\n");
else printf("%s is not a multiple of 11.\n");
}
}
回复
共 7 条回复,欢迎继续交流。
正在加载回复...