解题思路:
这题的关键在于乘号 以及下划线 你要直接去复制样例里面的 因为这些是特殊符号 你打印不出来 然后注意每个数字的输出位数 要注意位数的对齐 附上两个样例 5 × 2 ━━━ 10 87 ×76 ━━━ 522 609 ━━━ 6612 把这些数据复制到编译器里面就能显示正确的格式
参考代码:
#include<iostream> #include<cstdio> using namespace std; int main() { //freopen("data.in.txt","r",stdin); //freopen("data.out.txt","w",stdout); int a,b; while(cin>>a>>b) { printf("%4d\n",a); printf("×%2d\n",b); cout<<"━━━"<<endl; if(b>=10) { int b1=b%10; if(b1==0) printf(" 00\n"); else printf("%4d\n",b1*a); int b2=b/10; printf("%3d\n",b2*a); cout<<"━━━"<<endl; } printf("%4d\n",a*b); cout<<endl; } return 0; }
0.0分
9 人评分
C语言训练-尼科彻斯定理 (C++代码)浏览:675 |
C语言训练-求1+2!+3!+...+N!的和 (C++代码)浏览:1217 |
【出圈】 (C语言代码)用单项循环链表浏览:817 |
C二级辅导-计负均正 (C语言代码)浏览:601 |
C二级辅导-公约公倍 (C语言代码)浏览:2150 |
成绩转换 (C语言代码)浏览:1040 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:790 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:603 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:609 |
C语言程序设计教程(第三版)课后习题8.1 (C语言代码)浏览:1289 |