/ 科创班 /

记录详情

Accepted

/in/foo.c: In function 'main':
/in/foo.c:5:9: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'char (*)[50]' [-Wformat=]
 scanf("%s",&s);
         ^
# 状态 耗时 内存占用
#1 Accepted 2ms 256.0 KiB
#2 Accepted 2ms 256.0 KiB
#3 Accepted 2ms 256.0 KiB
#4 Accepted 2ms 256.0 KiB
#5 Accepted 2ms 256.0 KiB
#6 Accepted 2ms 256.0 KiB
#7 Accepted 2ms 256.0 KiB
#8 Accepted 3ms 256.0 KiB
#9 Accepted 2ms 256.0 KiB
#10 Accepted 2ms 256.0 KiB

代码

#include<stdio.h>
#define max 50
int main(){
char s[max],d[max];
scanf("%s",&s);
int i = 0;
while(s[i]!='\0'){
int r = ((s[i]>='a')?((s[i] + 4 - 'a')%26):((s[i] + 4 - 'A')%26));
d[i] = ((s[i]>='a')?'a':'A')+ r;
i++;
}
d[i] = '\0';
printf("%s",d);
return 0;
}

信息

递交者
类型
递交
题目
破译密码
题目数据
下载
语言
C
递交时间
2018-05-14 22:47:04
评测时间
2018-05-14 22:47:04
评测机
分数
100
总耗时
26ms
峰值内存
256.0 KiB