結果
| 問題 |
No.163 cAPSlOCK
|
| コンテスト | |
| ユーザー |
kazuki232
|
| 提出日時 | 2017-02-04 01:12:43 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 173 bytes |
| コンパイル時間 | 138 ms |
| コンパイル使用メモリ | 21,120 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-24 06:00:38 |
| 合計ジャッジ時間 | 963 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:9: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[100]’ [-Wformat=]
5 | scanf("%s",&bun);
| ~^ ~~~~
| | |
| | char (*)[100]
| char *
main.c:7:13: warning: implicit declaration of function ‘abs’ [-Wimplicit-function-declaration]
7 | bun[i]+=-32*abs(bun[i]-95)/(bun[i]-95);
| ^~~
main.c:2:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘abs’
1 | #include <stdio.h>
+++ |+#include <stdlib.h>
2 | int main(){
main.c:5:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%s",&bun);
| ^~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(){
int i=0;
char bun[100];
scanf("%s",&bun);
while(bun[i]!='\0'){
bun[i]+=-32*abs(bun[i]-95)/(bun[i]-95);
i++;
}
printf("%s\n",bun);
return 0;
}
kazuki232