1:
#include<stdio.h>intmain(void){
longint i,n;printf("This program prints a table of squares.\n");printf("Enter number of entries in table:");scanf("%ld",&n);for(i=1;i<=n;i++)printf("%10ld%10ld\n",i,i*i);//i最大46340输入到这里,i*i就会到达long int类型的最大值,我的电脑是2147395600。short的情况,i=180,i*i达到最大值//return0;}
2:
#include<stdio.h>int main (void){
int i, n;
printf ("This program prints a table of squares. \n");
printf ("Enter number of entries in table: ");
scanf ("%d",&n);getchar();//接收scanf留下的回车 这是个缓存区陷阱//for(i =1; i <= n; i++){
printf ("%10d%10d\n", i, i * i);if(i %24==0){
printf ("Press Enter to continue...");
getchar ();}}return0;}
3:
#include<stdio.h>int main (void){
double n, sum =0.0;
printf ("This program sums a series of integers.\n");
printf ("Enter inetgers (0 to terminate): ");
scanf ("%lf",&n);//这里scanf是用的%lf, printf是用的%f while(n !=0.0){
sum += n;
scanf ("%lf",&n);}
printf ("The sum is:%f\n", sum);return0;}
1:#include<stdio.h>int main(void){ long int i,n; printf("This program prints a table of squares.\n"); printf("Enter number of entries in table:"); scanf("%ld",&n); for(i=1;i<=n;i+...