1 GP
求幫C++作業 好得下去領500
作者:カミ│2015-01-03 19:44:31│巴幣:50│人氣:357
如題
1題500 不豪小
1.
請再輸入n=1時(就是打1) 輸出 *** (2的形狀
*
***
*
***
n=2時 *** *** (2 5的形狀
* *
*** ***
* *
*** ***
n=3時就是252以此類推
2.讀取TXT檔(只有英文大小寫、空格跟數字) 將文字中的大寫轉為"大"字 小寫轉為"小"字
空格轉為"空 "字 數字轉為"數"字
在輸出(這題我不會再轉為中文,下面是我弄得
clude <iostream.h>
#include <fstream.h>
using namespace std;
int main()
{
fstream file1,file2;
char tempword[500];
char ch;
int pi=0;
file1.open("in_a.txt",ios::in);
file2.open("out_a.txt", ios::out);
do{
file1.get(ch);
if (ch>='A' && ch<='Z')
*(tempword+pi)='大';
else if (ch>='a' && ch<='z')
*(tempword+pi)='小';
else
*(tempword+pi)='數';
pi++;
} while (! file1.eof());
*(tempword+pi)='\0';
cout << tempword << endl;
file2 << tempword << endl;
file1.close();
file2.close();
system("pause");
return 0;
}
拜託摟~
3.發票題
建立5組五碼的號碼 並在輸入號碼後得知是否中獎
4.input N=?
Σ(2ˉK+5K)
就是西格瑪K=1到N(2的負K次方+5的K次方)
引用網址:https://home.gamer.com.tw/TrackBack.php?sn=2704652
All rights reserved. 版權所有,保留一切權利
相關創作
留言共 0 篇留言
我要留言提醒:您尚未登入,請先
登入再留言
1喜歡★zxasqw0246 可決定是否刪除您的留言,請勿發表違反站規文字。
前一篇:噓...