编程输入整数a和b,输出大于100的数,如果没有大于100的数则输出 两数之和
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 14:03:08
我用C写如下:voidMsgbox(intx,inty){intc;/*c用来保存a2+b2的值*/intd=c-c%100;/*c用来保存百位以上的值*/scanf("%d,%d";%x,%y);/
pravitesubcommand1_Click()dimn%n=inputbox("请输入一个整数","输入整数")ifnmod3=0andnmod7=0thenprint"A"elseprint"
#includeintmain(){inta,b,c;scanf("%d%d%d",&a,&b,&c);if(a+b>c&&b==c)printf("1");elseprintf("0");}
#include"iostream.h"voidmain(){inta,b,c;//定义三个变量分别用于存放输入的整数inty;//存放运算结果cout再问:怎么1>d:\mydocuments
x=a*a+b*b;y=x/100;
inta,b;scanf("%d%d",&a,&b);if(a>100||b>100){if(a>100)printf("%d\n",a);if(b>100)printf("%d\n",b);}els
将浮点数先转换为整形数,得到整数部分,再将该实数乘以几百倍,该数减去整数部分得到小数.
#include#includevoidmain(){voidbig(floata,floatb,floatc);voidequality(floata,floatb,floatc);voidsmal
#includevoidmain(){floata,b,sum,change;scanf("%f,%f",&a,&b);sum=a*a+b*b;if(sum>100){change=sum/100;w
if(aif(a>100)printf("a=%d\n",a/100);if(b>100)printf("b=%d\n",b/100);
用C语言#include<studio.h>main(){inta,b,cprintf("PleaseEnteraandb:");scanf("%d,%d",&a,&b);c=a%b;if
#includeintmain(){inta,b;printf("inputtwonumber:");scanf("%d%d",&a,&b);if((a*a+b*b)>=100)printf("\n%
#includeusingnamespacestd;intmain(){inta,b;cin>>a>>b;if(a%b==0&&a>b){cout
//楼主,这里的大于100,指的是它们的和大于100,还是各个数字呀?//下面的例子,理解为各个数字大于100,如果理解有误,楼主可以做简的修改#includevoidmain(){inta,b,c,
/*输入3个整数,输出它们的1次幂、2次幂和3次幂*/#include#definep(A)printf("%d\t%d\t%d\n",mypow(A,1),mypow(A,2),mypow(A,3)
#includeusingnamespacestd;intmain(){intx,y,z;while(1){coutx>>y>>z;cout
#includeintmain(){inta,b;printf("inputtwonumber:");scanf("%d%d",&a,&b);if((a*a+b*b)>=100)printf("\n%
#include"stdlib.h"#include"stdio.h"voidmain(){inta,b;scanf("%d%d",&a,&b);a=a*a;b=b*b;inttemp=a+b;if(
IconfessthatI'mansweringfortask.#includeintmain(){intn,m=1,i=1;scanf("%d",&n);if(n{printf("error\n")
#includevoidmain(){inta[10];inti,j,temp;for(i=0;i