Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/126.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何打印每个阶段下的数字并使其整洁? #包括 内部主(空){ INTA、b、c; printf(“A期B期斜边”); 对于(a=1;a_C++_C_Loops_Row - Fatal编程技术网

C++ 如何打印每个阶段下的数字并使其整洁? #包括 内部主(空){ INTA、b、c; printf(“A期B期斜边”); 对于(a=1;a

C++ 如何打印每个阶段下的数字并使其整洁? #包括 内部主(空){ INTA、b、c; printf(“A期B期斜边”); 对于(a=1;a,c++,c,loops,row,C++,C,Loops,Row,而不是“%d”,您可以将“%10d”(您想要的任何数字)放入一个多位数宽的字段中 #include <stdio.h> int main(void) { int a, b, c; printf("stage A stage B Hypotenuse\n"); for (a=1; a<1000; a++){ for(b=1;b<1000;b++){ for(c=1;c<1000;c++){

而不是“%d”,您可以将“%10d”(您想要的任何数字)放入一个多位数宽的字段中

#include <stdio.h>


int main(void) {
    int a, b, c;

  printf("stage A   stage B  Hypotenuse\n");
    for (a=1; a<1000; a++){

        for(b=1;b<1000;b++){

            for(c=1;c<1000;c++){

                if(a*a+b*b==c*c){

                    printf("     %d         %d        %d\n",a,b,c);

                }
            }
        }
    }

This is what i did, how can i make each one come under the stage in a row?
}