标题:输入一个三位正整数,取出其百位、十位、个位。以下程序错在哪里?帮忙分析 ...
取消只看楼主
ydhetqz
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2014-10-23
 问题点数:0 回复次数:0 
输入一个三位正整数,取出其百位、十位、个位。以下程序错在哪里?帮忙分析看看。谢谢!
输入一个三位正整数,取出其百位、十位、个位。以下程序错在哪里?帮忙分析看看。谢谢!

#include "stdio.h"
void main()
{
    int b,baiwei,shiwei,gewei;
    printf("please input a positive integer");
    scanf("b=%d",&b);
    baiwei=b/100;
    shiwei=(b-baiwei*100)/10;
    gewei=b-baiwei*100-shiwei*10;
    printf("baiwei=%d,shiwei=%d,gewei=%d\n",baiwei,shiwei,gewei);
}
搜索更多相关主题的帖子: positive include please 正整数 
2014-10-23 20:31



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-437597-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.283796 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved