标签:
#include <cstdio> #include <iostream> #include <string> #include <sstream> #include <cstring> #include <stack> #include <queue> #include <algorithm> #include <cmath> #include <map> #define PI acos(-1.0) #define ms(a) memset(a,0,sizeof(a)) #define msp memset(mp,0,sizeof(mp)) #define msv memset(vis,0,sizeof(vis)) using namespace std; //#define LOCAL void fun(int num) { for(int x=1;x<=100;x++) for(int y=1;y<=100;y++) for(int z=1;z<=100;z++) if(x*x+y*y+z*z==num) {printf("%d %d %d\n",x,y,z);return;} } int main() { #ifdef LOCAL freopen("in.txt", "r", stdin); #endif // LOCAL ios::sync_with_stdio(false); int num; while(cin>>num)fun(num); return 0; }
标签:
原文地址:http://www.cnblogs.com/gpsx/p/5189932.html