C++
- voluntas
- @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
20
1
2
3
4
using namespace std;
5
std::string;
6
int main(void)
7
{
8
double x = 7.7, y = 9.8, a = 3.1, b = 5.2, sqrt, lg, cub, tg, pow ,t1,t2;
9
printf("enter x,y>");
10
cout <<(t1 = 1 / (pow)(b, 3) (lg) (y / x) (pow)(a, 2)(pow)(x, 2) / (pow)(2*y, 2));
11
cout << (t2 = (1 / a)(tg)(a*x / 2) + (1 / a)(log) * tg * (a * x / 2));
12
printf("t1=%lg\n");
13
printf("t2=%lg\n");
14
printf("log(%f)=%f\n");
15
printf("tan(%f)=%f\n");
16
printf("pow(%f)=%f\n");
17
printf("sqrt(%f)=%f\n");
18
printf("exp(%f)=%f\n");
19
return 0;}
20
$ g++ prog.cc -Wall -Wextra -std=c++98 -pedantic
Start
prog.cc:5:6: error: declaration does not declare anything [-fpermissive] 5 | std::string; | ^~~~~~ prog.cc: In function 'int main()': prog.cc:10:28: error: 'pow' cannot be used as a function 10 | cout <<(t1 = 1 / (pow)(b, 3) (lg) (y / x) (pow)(a, 2)(pow)(x, 2) / (pow)(2*y, 2)); | ^ prog.cc:10:80: error: 'pow' cannot be used as a function 10 | cout <<(t1 = 1 / (pow)(b, 3) (lg) (y / x) (pow)(a, 2)(pow)(x, 2) / (pow)(2*y, 2)); | ^ prog.cc:11:25: error: expression cannot be used as a function 11 | cout << (t2 = (1 / a)(tg)(a*x / 2) + (1 / a)(log) * tg * (a * x / 2)); | ^ prog.cc:11:49: error: expression cannot be used as a function 11 | cout << (t2 = (1 / a)(tg)(a*x / 2) + (1 / a)(log) * tg * (a * x / 2)); | ^ prog.cc:12:14: warning: ISO C++98 does not support the '%lg' gnu_printf format [-Wformat=] 12 | printf("t1=%lg\n"); | ^ prog.cc:12:14: warning: format '%lg' expects a matching 'double' argument [-Wformat=] 12 | printf("t1=%lg\n"); | ~~^ | | | double prog.cc:13:14: warning: ISO C++98 does not support the '%lg' gnu_printf format [-Wformat=] 13 | printf("t2=%lg\n"); | ^ prog.cc:13:14: warning: format '%lg' expects a matching 'double' argument [-Wformat=] 13 | printf("t2=%lg\n"); | ~~^ | | | double prog.cc:14:14: warning: format '%f' expects a matching 'double' argument [-Wformat=] 14 | printf("log(%f)=%f\n"); | ~^ | | | double prog.cc:14:18: warning: format '%f' expects a matching 'double' argument [-Wformat=] 14 | printf("log(%f)=%f\n"); | ~^ | | | double prog.cc:15:14: warning: format '%f' expects a matching 'double' argument [-Wformat=] 15 | printf("tan(%f)=%f\n"); | ~^ | | | double prog.cc:15:18: warning: format '%f' expects a matching 'double' argument [-Wformat=] 15 | printf("tan(%f)=%f\n"); | ~^ | | | double prog.cc:16:14: warning: format '%f' expects a matching 'double' argument [-Wformat=] 16 | printf("pow(%f)=%f\n"); | ~^ | | | double prog.cc:16:18: warning: format '%f' expects a matching 'double' argument [-Wformat=] 16 | printf("pow(%f)=%f\n"); | ~^ | | | double prog.cc:17:15: warning: format '%f' expects a matching 'double' argument [-Wformat=] 17 | printf("sqrt(%f)=%f\n"); | ~^ | | | double prog.cc:17:19: warning: format '%f' expects a matching 'double' argument [-Wformat=] 17 | printf("sqrt(%f)=%f\n"); | ~^ | | | double prog.cc:18:14: warning: format '%f' expects a matching 'double' argument [-Wformat=] 18 | printf("exp(%f)=%f\n"); | ~^ | | | double prog.cc:18:18: warning: format '%f' expects a matching 'double' argument [-Wformat=] 18 | printf("exp(%f)=%f\n"); | ~^ | | | double prog.cc:8:44: warning: unused variable 'sqrt' [-Wunused-variable] 8 | double x = 7.7, y = 9.8, a = 3.1, b = 5.2, sqrt, lg, cub, tg, pow ,t1,t2; | ^~~~ prog.cc:8:54: warning: unused variable 'cub' [-Wunused-variable] 8 | double x = 7.7, y = 9.8, a = 3.1, b = 5.2, sqrt, lg, cub, tg, pow ,t1,t2; | ^~~
1
Finish