编写程序实现如下功能:输入两个两位数的整数a,b,将a,b合并形成一个整数放在c

来源:百度知道 编辑:UC知道 时间:2024/06/17 21:43:20
各位大哥大姐帮帮忙

#include <stdio.h>
#include <math.h>
void main()
{
int a,b,c;

feitwo:printf("请分别输入两个两位数整数a、b值:");/*非两位数时转到此处*/
scanf("%d%d",&a,&b);

if((sqrt(a)<10||sqrt(a)>=100))||(sqrt(b)<10||sqrt(b)>=100)
goto feitwo;/*非两位数时转到feitwo*/

if(a<0&b<0) /*都是负数时处理*/
c=-(100*sqrt(a)+sqrt(b));
esle if(a>0&b>0) /*都是正数时处理*/
c=100*a+b;
else /*一正一负时处理*/
{printf("一正一负规则未定,请重新输入!\n");
goto feitwo;
}

printf("合并后的整数为:%d\n",c);
}

#include <stdio.h>
main()
{
int a,b,c;
scanf("%d%d",&a,&b);
c=100*a+b;
printf("%d",c);
}

都没说是用什么语言...