HELP!!!
查看原帖
HELP!!!
1491571
zhaolinbaobao139楼主2025/2/6 20:04

用自己的IDE运行没事,一上洛谷就WA了

#include <iostream>
#include <cmath>
using namespace std;
int a,b,c,n,C;
int main(){
	cin >> n;
	for(;c<=n;c++){
		for(;b<=c;b++){
			for(;a<=b;a++){
				if(pow(a,2)+pow(b,2)==pow(c,2)){
					C++;
				}
			}
		}
	}
	cout << C << endl;
} 
2025/2/6 20:04
加载中...