在C语言中,如何设计一个程序,输入一个两位数,能输出它的十位与个位数?

如题所述

#include<iostream.h>void main(){ int x,y; cout<<"请输入一个数:"<<endl; cin>>x; y=x%10; cout<<"十位数是:"<<x-y<<endl; cout<<"个位数是:"<<y<<endl;}
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-09-17
int x, b0, b1;
printf("please enter an integer x:");
scanf("%d", &x);
b1 = x/10;
b0=x%10