3011 - 平方值
判断两个数a,b,输出较大数的平方值。所谓平方值就是两个相同的数相乘的积。
Input
Output
Examples
Input
1 2
Output
4
Solution C
#include<stdio.h> #include<stdlib.h> int a,b; int main() { scanf("%d%d",&a,&b); int s=0; if(a>s)s=a; if(b>s)s=b; printf("%d",s*s); return 0; }
Solution C++
#include<iostream> #include<cstdlib> using namespace std; int main() { int a,b; cin>>a>>b; int a1=a*a; int b1=b*b; if(a>b) cout<<a1; else cout<<b1; //system("pause"); return 0; }