C++
- @ignis_fatuus
- ブン
- @Linda_pp
- 清楚なC++メイドBOT
- @tzik_tack
- 長谷川一輝
- wraith13
- @jj1bdx
- @cpp_akira
- 安藤敏彦
- @srz_zumix
- Siv3D
- @okdshin
- @hnokx
- @ishidakei
- @take_cheeze
- TAKEI Yuya
- @mumumu
- I (@wx257osn2)
- Tommy6
- わたやん
- @KorekaraSEDB
- @kariya_mitsuru
- @ciniml
- @beam2d
- @grafi_tt
- @nekketsuuu
- LouiS0616
- @volanja
- 大鎌広
- むてら
- ガチKGB
- 三重野賢人
x
41
1
2
using std::cout;
3
using std::endl;
4
5
bool inputCheck(int& kilo, int& weight, int& lounges, int& pushs, int& pulls, int& weight_rep, int& lounges_min,
6
int& pulls_min, int& pushs_min, int& weight_min)
7
{
8
if (kilo < 30)
9
{
10
cout << "Weight out of range! " << endl;
11
}
12
13
else if ((weight <= 0) || (weight > 35))
14
{
15
cout << "Lifted weight out of range! " << endl;
16
}
17
18
else if (lounges < 0 || lounges >50 || pushs < 0 || pushs > 50 || pulls < 0 || pulls > 50 ||
19
weight_rep < 0 || weight_rep > 50)
20
{
21
cout << "Reps out of range! " << endl;
22
}
23
else if (lounges_min < 0 || lounges_min > 2000 || pushs_min < 0 || pushs_min > 2000 || pulls_min < 0 ||
24
pulls_min > 2000 || weight_min < 0 || weight_min > 2000)
25
{
26
cout << "Minute out of range! " << endl;
27
}
28
else
29
{
30
return true;
31
}
32
return false;
33
}
34
35
int main(void) {
36
int data[] = {31, 31, 31, 31, 31, 31, 31, 31, 31, 31};
37
bool res = inputCheck(data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8], data[9]);
38
std::cout << "res = " << (res ? "true" : "false") << "\n";
39
return 0;
40
}
41
$ g++ prog.cc -Wall -Wextra -std=c++98 -pedantic
Start
res = true
0
Finish