Compile Error
foo.cc: In function 'int main()': foo.cc:16:40: error: expected ')' before '{' token 16 | if(hy*hy == (h*h + b*b){ | ~ ^ | ) foo.cc:22:2: error: expected statement at end of input 22 | } | ^ foo.cc:22:2: error: expected '}' at end of input foo.cc:11:19: note: to match this '{' 11 | while(t--){ | ^ foo.cc:22:2: error: expected '}' at end of input 22 | } | ^ foo.cc:5:1: note: to match this '{' 5 | { | ^
Code
#include <iostream>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int t, b, h, hy;
cin >> t;
while(t--){
cin >> b;
h = 4 * (b / 3);
hy = 5 * (b / 3);
if(hy*hy == (h*h + b*b){
cout << b + h + hy;
}else{
cout << -1;
return 0;
}
Information
- Submit By
- Type
- Pretest
- Problem
- P1027 Right triangle
- Language
- C++20 (G++ 13.2.0)
- Submit At
- 2024-03-06 14:34:57
- Judged At
- 2024-11-11 03:41:52
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes