#include <stdio.h> #include <math.h> int main(){ int n,count=0; if (scanf("%d",&n)!=EOF){ int s = sqrt(n); //printf("s = %d\n",s); // 计算150,分配给5,2,1,总数得是100 for (int i=1;i<=s;i++){ for (int j=1;j<=s;j++){ if (i<=j){if (i*i+j*j==n){printf("%d %d\n",i,j);count++;}} } } if (count==0){printf("No Solution");} } else{ printf("input wrong"); } return 0; }