This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int num[10], AL; | |
cout << "請輸入要算的10個平均數(小數點會不見):\n"; | |
for( int t = 0,plus ; t < 10 ; t ++ ){ | |
cin >> num[t]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int AL, men; | |
cout << "請輸入要算{幾個數}的平均數:\n"; | |
cin >> men; | |
int num[men]; | |
cout << "請輸入要算的" << men << "個數的平均數的數值(小數點會不見):\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int sub, men; | |
cout << "請輸入要算{幾個學生}的成績平均:\n"; | |
cin >> men; | |
cout << "請輸入要算{幾種}科目的平均(小數點後會直接捨去):\n"; | |
cin >> sub; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int x; | |
cout << "please input the num:"; | |
cin >> x; | |
cout << "type 1:\n"; | |
for ( int t = 0 ; t < x ; t ++ ){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int watchdogs2 = 0; | |
for ( ; watchdogs2 == 0 ; ){ | |
char num[100]; | |
for ( int t = 0 ; t < 100 ; t ++ ){ | |
num[t] = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int year, yearT, day, w, m, date, dbf, dafeb; | |
//年 1990後幾年 1990後總天 1號前有幾個 月(變) 日 1前空(day before first) 2月有幾天 | |
cout << "y"; | |
cin >> year; | |
yearT = year - 1990; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
char o[10]; | |
int total ,f[2]; | |
cout << "身份證字號檢查\n請輸入身份證字號:"; | |
cin >> o; | |
switch (o[0]){ | |
case 'A': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <time.h> | |
#include <stdlib.h> | |
using namespace std; | |
int main() | |
{ | |
int o[9]; | |
o[0] = 0; | |
srand ( time(NULL) ); | |
for ( int t = 1 ; t < 9 ; t ++ ){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
int a, b = 0; | |
cout << "你想要比較幾個數?"; | |
cin >> a; | |
int x[a]; | |
for ( int t = 0 ; t < a ; t ++ ){ | |
cin >> x[t]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main(){ | |
int x; | |
while (cin>>x){ | |
if (x>0){ | |
cout << x*2-1 << "\n"; | |
} else if (x<0){ | |
cout << x*-2 << "\n"; | |
} |