C語言,輸入一串字元,對其中的英文本母進行大小寫變換後輸出,非英文本母照原樣輸出,程式怎麼寫

2021-04-13 01:49:02 字數 1612 閱讀 7986

1樓:匿名使用者

#include

#include

#define max 100

void main()

for(i=0;i<=count;i++)for(i=0;i<=count;i++)}

2樓:聞志豪

這個好像要用到ascll碼來寫,大寫字母的ascll碼總是小於小寫字母32.。。如:a的ascll碼是97,a的ascll碼是97-32=65。。。。。具體程式你自己在想想吧

3樓:匿名使用者

#include

int main()

c語言程式:要求反覆從鍵盤上輸入乙個字元,對字母進行大小寫轉換;若輸入的不是字母則報錯;直到鍵入 20

4樓:匿名使用者

從鍵盤上輸入乙個字元,對字母進行大小寫轉換,非英文本母照原樣輸出。

#include

void main()

for(i=0;i<100;i++)

cout<=0 && a[i][j]<=9)else if( a[i][j]>='a' && a[i][j]<='z' )

else if (a[i][j]>='a' && a[i][j]<='z')

else break;

也是搜到的,看有沒有幫助。

5樓:匿名使用者

#include

#include

#include

int main()

if(a>=97)printf("%c的大寫字母是%c\n",a,a-32);

else     printf("%c的小寫字母是%c\n",a,a+32);

}while(a!='\n');

printf("一共輸入了%d個字母和%d個非字母(其中有乙個是按回車時的換行符)。\n",i,1+j);

return 0;}

6樓:滄海雄風

2error!ef

edf&

error!

error!

character is 5,noncharacter is **ress any key to continue#include

main()

else if (ch>='a'&&ch<='z')else

} while (ch!='\n');

printf("character is %d,noncharacter is %d\n",character,nonch);}

如何用c語言編寫程式「輸入一串字元(換行符結束),用迴圈語句將其中的大小寫英文本母互換後輸出」

7樓:匿名使用者

#include

int main()

else

if ('a' <= c[i] && c[i] <= 'z')i++;

}printf ("%s", c);

return 0;}

8樓:三角戀你的錯

k.jewbrkwhrqwkehwoiehrlwkehr

c語言鍵盤輸入字串刪除其中的母音字母

include stdafx.h if the vc 6.0,with this line.include stdio.h int main void 回答 include stdafx.h if the vc 6.0,with this line.include stdio.h int main ...

設計c程式,輸入並儲存一串不超過字元的字串,計算並輸出其中大寫字

include include int main void return include include int main printf n一共有 d個大寫字母 n return 0 c語言 從鍵盤輸入乙個不超過100個字元的字串,其中字串只包括字母 數字 空格三種字元。1 首先需要開啟copy程式...

c語言統計字母出現次數,C語言程式設計輸入一串字母,統計每個字母出現的次數

看我旁邊做的註解 t s,array 呼叫子函式 t,並傳給引數s,array。s是字元陣列,相當於字串指標 array是陣列好理解 for i 0 i 26 i printf d array i for迴圈 依次輸出26個字母出現的次數。這裡 d後面加個空格或逗號分隔才好 printf n 子函式...