int x,y,z,m;printf("请输入一个有三个位的整数:");scanf("%d",&m);x=m/100;y=m/10-10*x;z=m%10;printf("百位:%d\n",x);printf("十位:%d\n",y);printf("个位:%d\n",z);} 在vc++6.0上测试可以,如果有问题可以联系我 ...
readln(x); (输入)ge:=x mod 10; (求个位上的数字)bai:=x div 100; (求百位上的数字)shi:=x div 10 -bai*10; (求十位上的数字)writeln(ge,shi:2,bai:2); (输出)end.2编程:program t2;type day=(jintianshixingqi1,jintianshixing...
readln(x); (输入)ge:=x mod 10; (求个位上的数字)bai:=x div 100; (求百位上的数字)shi:=x div 10 -bai*10; (求十位上的数字)writeln(ge,shi:2,bai:2); (输出)end.2编程:program t2;type day=(jintianshixingqi1,jintianshixing...
n:=n div 10; //删去十位数,留下个位数 writeln(i,' ',j,' ',n);end.