社区讨论
0分,求助大佬
P1603斯诺登的密码参与者 2已保存回复 3
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 3 条
- 当前快照
- 1 份
- 快照标识符
- @lobf1dm7
- 此快照首次捕获于
- 2023/10/29 19:56 2 年前
- 此快照最后确认于
- 2023/11/04 01:30 2 年前
C
#include <stdio.h>
#include <string.h>
int main()
{
int n,i,j,c[10000]={0},h,v,t=0,q;
char a[10000],b[25][20]={"zero","one","two","three","four","five","six","seven","eight","night","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty"};
for(j=0;j<6;j++)
{
scanf("%s",a);
n=strlen(a);
if(a[0]>='A'&&a[0]<='Z')
a[0]+=32;
if(a[n-1]=='.')
a[n-1]='\0',n--;
for(i=0;i<21;i++)
{
if(strcmp(a,b[i])==0)
{
h=((i)*(i))%100;
if(h!=0) c[q++]=h;
}
}
if(strcmp(a,"first")==0)
{
h=((1)*(1))%100;
if(h!=0) c[q++]=h;
}
else if(strcmp(a,"a")==0)
{
h=((1)*(1))%100;
if(h!=0) c[q++]=h;
}
else if(strcmp(a,"another")==0)
{
h=((1)*(1))%100;
if(h!=0) c[q++]=h;
}
else if(strcmp(a,"both")==0)
{
h=((2)*(2))%100;
if(h!=0) c[q++]=h;
}
else if(strcmp(a,"second")==0)
{
h=((2)*(2))%100;
if(h!=0) c[q++]=h;
}
else if(strcmp(a,"third")==0)
{
h=((3)*(3))%100;
if(h!=0) c[q++]=h;
}
}
if(q==0)
printf("0");
else
{
for(i=0;i<q-1;i++)
for(v=0;v<q-1;v++)
{
if(c[v]==0)
t++;
if(c[v]>c[v+1])
{
int tem=c[v];
c[v]=c[v+1];
c[v+1]=tem;
}
}
for(i=t;i<q;i++)
{
if(i==0+t)
printf("%d",c[i]);
else
printf("%02d",c[i]);
}
}
return 0;
}
回复
共 3 条回复,欢迎继续交流。
正在加载回复...