void main()
{ int x,y,sum;
printf(" INPUT X,Y ");
scanf("%d",&x);
scanf("%d",&y);
sum=x*x+y*y;
printf("%d*%d+%d*%d=%d",x,x,y,y,sum);
getch();
}
扩展资料
三个整数输出的平方和:
#include<stdio.h>
int main()
{
int a,b,c,d;
scanf("%d %d %d",&a,&b,&c);
d=a*a+b*b+c*c;
printf("%d",d);
return 0;
}
编写程序,要求输入两个整数,求他们的平方和
void main(){ int x,y,sum;printf(" INPUT X,Y ");scanf("%d",&x);scanf("%d",&y);sum=x*x+y*y;printf("%d*%d+%d*%d=%d",x,x,y,y,sum);getch();}
输入两个整数,求两数的平方和与立方和
include <stdio.h>#include <math.h> int main() { int a,b; printf("请输入两个整数(逗号隔开) : "); scanf("%d,%d",&a,&b); printf("平方和是 : %.2lf\\n",pow((a,2) + pow(b,2)); printf("立方和是 : %.2lf\\n",pow((a,3) + pow(b,3)); return 0;} ...
讲解,C语言 输入2个整数,求两数的平方和并输出。
printf("请输入两个整数:\\n"); \/*输出提示信息*\/ scanf("%d%d",&a,&b); \/*从键盘接收两个整数值*\/ c=a*a+b*b; \/*计算两数平方和并赋值给c*\/ printf("两数的平方和为:%d\\n",c); \/*输出两数平方和*\/ return 0;} ...
编写一个程序,输入两个整数,计算并输出它们的和,乘积,差,商和平方和的...
include <stdio.h> void main(){ int a,b;printf("Input two integers:");scanf("%d%d",&a,&b);printf("和:a+b=%d\\n",a+b);printf("差:a-b=%d\\n",a-b);printf("积:a*b=%d\\n",a*b);printf("商:a\/b=%d\\n",a\/b);printf("余数:a%b=%d\\n",a%b);...
用语言编程输入两个整数,输出他们的平方和他们的平方根
include<stdio.h> #include <math.h > void main(){ int a,b,c,d;double e,f;scanf("%d%d",&a,&b);c=a*a;d=b*b;e=sqrt(a);f=sqrt(b);printf("%d\\n%d\\n%lf\\n%lf\\n",c,d,e,f);}
C语言 输入两个整数,求它们的平方和(a^2+b^2)。用带参数的宏来...
include <stdio.h> define DEX(x,y) (x*x+y*y)int main(void){ int a, b;printf("输入两个数:");scanf(" %d %d", &a, &b);printf("结果:%d\\n", DEX(a, b));return 0;}
C++:编写程序,从键盘上输入两个数,求这两个数的平方和,用函数实现;
include<stdio.h>int op(int m,int n){return m*m + n*n;}int main(){int m,n;scanf("%d %d",&m,&n);int ans = op(m,n);printf("%d\\n",ans);return 0;}
c语言课题;输入2个整数,计算它们的平方根之和,并输出结果.(要求结果保留...
include <stdio.h> include <math.h> int main(){ int a,b;scanf("%d%d",&a,&b);printf("%.2f\\n",sqrt(a)+sqrt(b));return 0;}
写一个函数,求两个整数的平方和,用mian函数调用这个函数并输出结果,两...
include <stdio.h> main (){ int a,b;printf ("输入整数a,b:");scanf ("%d,%d", &a, &b);c = func (a,b);printf ("a*a+b*b=%d\\n", c);} int func (int i, int j){ return (i*i+j*j);}
...求解两个整数的平方和,并在main当中输入两个整数验证结果
要求的程序已经调试通过:include<stdio.h> long squaresum(long a,long b){ return a*a+b*b;} int main(){ long a,b;scanf("%ld %ld",&a,&b);printf("%ld^2+%ld^2=%ld\\n",a,b,squaresum(a,b));getch();return 0;}