| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1754 人关注过本帖
标题:c++乘法竖式
只看楼主 加入收藏
万致远醉帥
Rank: 2
等 级:论坛游民
威 望:1
帖 子:88
专家分:35
注 册:2020-3-24
结帖率:100%
收藏
 问题点数:0 回复次数:3 
c++乘法竖式
程序代码:
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
    short chengshu, beichengshu;
    cout << "两位乘法"<<endl;
    cin >> chengshu >> beichengshu;
    system("cls");
    cout << setw(7) << chengshu << endl;
    cout << setw(1) << "×" << setw(5) << beichengshu<<endl;
    cout << setw(7)<<"-------";
    cout << endl;
    cout << setw(7) << chengshu * (beichengshu % 10)<<endl;
    cout << setw(6) << chengshu * (beichengshu / 10)<<endl;
    cout << setw(7) << "-------"<<endl;
    cout << setw(7) << beichengshu * chengshu;
    while (true)
    {

    }

}
搜索更多相关主题的帖子: c++ 乘法 include short cout 
2020-03-28 09:59
万致远醉帥
Rank: 2
等 级:论坛游民
威 望:1
帖 子:88
专家分:35
注 册:2020-3-24
收藏
得分:0 
两位数的

我们遇到什么困难,也不要怕,微笑着面对他,消除恐惧的最好方法就是面对恐惧。
2020-03-28 10:02
雪影辰风
Rank: 6Rank: 6
来 自:衡阳市
等 级:贵宾
威 望:22
帖 子:177
专家分:387
注 册:2019-6-17
收藏
得分:0 
回复 2楼 万致远醉帥
代码写的很不错,不过最后那个死循环可以考虑用pause写,另外就是main函数最好加上一个return 0;,虽然不是必须的,但还是按照编程标准来吧!
2020-04-03 20:38
qlw200966
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2020-4-3
收藏
得分:0 
不用这么麻烦吧,我只用了9行。
2020-04-03 21:18
快速回复:c++乘法竖式
数据加载中...
 
   



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

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