这题简单的C语言程序怎么编?本人刚学C语言,请教各位高手!详细见补充。

[复制链接]
查看11 | 回复3 | 2011-3-16 16:23:59 | 显示全部楼层 |阅读模式
#include int main(){
int num;
printf("输入整数:");
scanf("%d", &num);
printf("\nthe input num is %d\n", num);
printf("the tens is: %c\n", char((num/10) + '0'));//此处可以加char转换,也可以不加
printf("the units is: %c\n", char((num%10) + '0'));//此处可以加char转换,也可以不加
retur...
回复

使用道具 举报

千问 | 2011-3-16 16:23:59 | 显示全部楼层
#include int main(){ int integer=0; //一般定义变量就初始化 int ten=0; int bits=0; char str_ten,str_bits; printf("please input the two integer number:\n"); scanf("%...
回复

使用道具 举报

千问 | 2011-3-16 16:23:59 | 显示全部楼层
#include void main(){
int num;
int i,j;
printf("enter an integer(9>setw(3)>>value; if ('0' <= value[0] && va...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行