第一个:
#include
main()
{
int a,b;
for(a=1;a<=9;a++)
{for(b=1;b<=a;b++)
printf("%d*%d=%2d ",a,b,a*b);
printf("\n");
}
return 0;
}
第二个:
#include
main()
{float a,b,s;
char op;
printf("Enter a,op,b:\n");
scanf("%f%c%f",&a,&op,&b);
if(op=='+')
s=a+b;
else if(op=='-')
s=a-b;
else if(op=='*')
s=a*b;
else if(op=='/')
s=a/b;
printf("s is %f\n",s);
return 0;
}
望采纳!!!