結果

問題 No.163 cAPSlOCK
ユーザー dai11
提出日時 2017-06-28 10:02:53
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 347 bytes
コンパイル時間 1,233 ms
コンパイル使用メモリ 158,868 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-04 14:41:33
合計ジャッジ時間 2,191 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main(int, char**)’:
main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%s",S);
      |         ~~~~~^~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main(int argc, char **argv) {
	char S[100];
	int i=0;
	int t=0;
	
	scanf("%s",S);
	for(i = 1;i<=strlen(S);i++)
		{
			if((S[t]>=65) && (S[t]<=90))
			{
				S[t] = S[t] + 32;
			}	
		 else	if((S[t]>=97) && (S[t]<=122))
			{
				S[t] = S[t] - 32;
			}
			t++;
		}
			printf("%s\n",S);
	return 0;
}
0