当前位置:网站首页>99 multiplication table - C language
99 multiplication table - C language
2022-06-27 22:35:00 【Meow meow more】
(1) Nine Nine Multiplication Table lower left triangle print
#include<stdio.h>
int main(){
int i, j, sum;
for(i=1;i<=9;i++){
for(j=1;j<=i;j++){
sum=i*j;
printf("%d * %d= %2d ",i,j,sum);
}
printf("
");
}
return 0;
}
(2) Lower right triangle print
#include<stdio.h>
int main(){
int i, j,k, sum;
for(i=1;i<=9;i++){
for(k=1;k<=9-i;k++){
printf(" ");
}
for(j=1;j<=i;j++){
sum=i*j;
printf("%d * %d= %2d ",i,j,sum);
}
printf("
");
}
return 0;
}
(3) Upper right triangle print
#include<stdio.h>
int main(){
int i, j, sum;
for(i=1;i<=9;i++){
for(j=1;j<=9;j++){
if(j<i){
printf(" ");
}
else{
sum=i*j;
printf("%d * %d= %2d ",i,j,sum);
}
}
printf("
");
}
return 0;
}
(4) Upper left triangle print
#include<stdio.h>
int main(){
int i, j, sum;
for(i=1;i<=9;i++){
for(j=i;j<=9;j++){
sum=i*j;
printf("%d * %d= %2d ",i,j,sum);
}
printf("
");
}
return 0;
}
(5) Rectangular 99 multiplication table printing
#include<stdio.h>
int main(){
int i, j, sum;
for(i=1;i<=9;i++){
for(j=1;j<=9;j++){
sum=i*j;
printf("%d * %d= %2d ",i,j,sum);
}
printf("
");
}
return 0;
}
边栏推荐
- 软件测试自动化测试之——接口测试从入门到精通,每天学习一点点
- 结构化机器学习项目(二)- 机器学习策略(2)
- 【微服务】(十六)—— 分布式事务Seata
- Introduction to ARCS Model
- xpath
- Selenium上传文件有多少种方式?不信你有我全!
- Go from introduction to practice -- shared memory concurrency mechanism (notes)
- Yarn中RMApp、RMAppAttempt、RMContainer和RMNode状态机及其状态转移
- Penetration learning - shooting range chapter - detailed introduction to Pikachu shooting range (under continuous update - currently only the SQL injection part is updated)
- Secret script of test case design without leakage -- module test
猜你喜欢
从学生到工程师的蜕变之路
Educational Codeforces Round 108 (Rated for Div. 2)
Day 7 of "learning to go concurrent programming in 7 days" go language concurrent programming atomic atomic actual operation includes ABA problem
Structured machine learning project (I) - machine learning strategy
Codeforces Round #719 (Div. 3)
Yolov6: the fast and accurate target detection framework is open source
crontab定时任务常用命令
01 golang environment construction
爬虫笔记(3)-selenium和requests
【微服务】(十六)—— 分布式事务Seata
随机推荐
It smells good. Since I used Charles, Fiddler has been completely uninstalled by me
管理系统-ITclub(下)
Go from introduction to practice - error mechanism (note)
Macro task and micro task understanding
Is flush stock trading software reliable?? Is it safe?
结构化机器学习项目(一)- 机器学习策略
C # QR code generation and recognition, removing white edges and any color
crontab定时任务常用命令
美团20k软件测试工程师的经验分享
Dialogue with Qiao Xinyu: the user is the product manager of Wei brand, and zero anxiety defines luxury
Crawler notes (1) - urllib
不外泄的测试用例设计秘籍--模块测试
Yarn performance tuning of CDH cluster
Typescript learning
QT large file generation MD5 check code
How to do function test well? Are you sure you don't want to know?
Golang uses regularity to match substring functions
【mysql实战】查询语句实战演示
Yarn中RMApp、RMAppAttempt、RMContainer和RMNode状态机及其状态转移
Conversation Qiao Xinyu: l'utilisateur est le gestionnaire de produits Wei Brand, zéro anxiété définit le luxe