C言語なら俺に聞け(入門篇) Part 8
■ このスレッドは過去ログ倉庫に格納されています
0016デフォルトの名無しさん
2007/02/20(火) 21:30:24/* 大文字・小文字の変換 */
#include <stdio.h>
#include <ctype.h>
main()
{
char str_i[256]、 str_o[256];
int i、j;
/* データ入力 */
printf("文字列を入力して下さい");
scanf("%s"、str_i);
/* 変換 */
for(i=0、j=0;str_i[i] != '\0';i++){
if(isupper(str_i[i]))
str_o[j++]= 【38】;
else if(【39】)
str_o[j++] = 【40】;
else
str_o[j++] = 【41】;
}
【42】;
printf("%s"、str_o);
}
■ このスレッドは過去ログ倉庫に格納されています