瀏覽單個文章
㊣經藝湘㊣
*停權中*
 

加入日期: Mar 2010
文章: 4
Question C++嫩咖一問,跪求大家幫忙

使用者輸入一字串並輸入1.2.3.執行
1.轉大寫(用strupr字串轉換函數)
2.轉小寫 strlwr
3.大小寫互轉
重點要用函數表達


#include <iostream>
#include <cstdlib>
using namespace std;
void star(char);
int main()

{
char a[20];
int b;
cout<<"input a string";

cin.getline(a,20);
cout<<"1.轉大寫2.轉小寫3.大小寫互轉";
cin>>b;
if (b=1)
star(a[20]);


system("pause");
return 0;

}
void star(char a)
{
strlwr(a);
cout<<a<<endl;
}
/*這裡就不行了...
*/

初學者中的初學者,希望大家能盡量講的簡單一點
感激不盡
     
      
舊 2010-06-09, 12:10 AM #1
回應時引用此文章
㊣經藝湘㊣離線中