2018-10-10から1日間の記事一覧

多文字列の格納。

// 20個の文字列を格納する。1文字列あたり100文字。 // 格納後に表示。 #include <stdio.h> int main(void) { char str[20][100]; for(int i=0; i<20; i++) { scanf("%s", str[i]); } printf("\r\nkekkka\r\n"); for(int k=0; k<20; k++) { printf("%s\r\n", str[k]</stdio.h>…

小文字列を大文字列化

#include <stdio.h> #include <ctype.h> //toupper用 void ToBig(char *s); //プロトタイプ宣言 int main(void) { char str[100]; scanf("%s", str); ToBig(str); printf("%s", str); return 0; } void ToBig(char *s) { while(*s) { *s = toupper(*s); s++; } }…</ctype.h></stdio.h>