当前位置:网站首页>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;
}
边栏推荐
- Transformation from student to engineer
- How to prioritize the contents in the queue every second
- gomock mockgen : unknown embedded interface
- Solve the problem that the virtual machine cannot be connected locally
- 改善深层神经网络:超参数调试、正则化以及优化(三)- 超参数调试、Batch正则化和程序框架
- Is it safe to open a stock account through the account opening link given by the CICC securities manager? I want to open an account
- Gbase 8A method for reducing the impact on the system by controlling resource usage through concurrency during node replacement of V8 version
- 从学生到工程师的蜕变之路
- 6G显卡显存不足出现CUDA Error:out of memory解决办法
- Exclusive interview with millions of annual salary. What should developers do if they don't fix bugs?
猜你喜欢

Codeforces Round #717 (Div. 2)

管理系統-ITclub(下)

go语言切片Slice和数组Array对比panic: runtime error: index out of range问题解决

单元测试界的高富帅,Pytest框架,手把手教学,以后测试报告就这么做~

Dialogue with Qiao Xinyu: the user is the product manager of Wei brand, and zero anxiety defines luxury

Exclusive interview with millions of annual salary. What should developers do if they don't fix bugs?

Login credentials (cookie+session and token token)

改善深层神经网络:超参数调试、正则化以及优化(三)- 超参数调试、Batch正则化和程序框架

VMware virtual machine PE startup

对话乔心昱:用户是魏牌的产品经理,零焦虑定义豪华
随机推荐
Figure countdownlatch and cyclicbarrier based on AQS queue
软件缺陷管理——测试人员必会
Crawler notes (1) - urllib
Read write separation master-slave replication of MySQL
Codeforces Round #716 (Div. 2)
MySQL greater than less than or equal to symbol representation
渗透学习-靶场篇-pikachu靶场详细攻略(持续更新中-目前只更新sql注入部分)
Is it safe to open a stock account through the account opening link given by the CICC securities manager? I want to open an account
信通院举办“业务与应用安全发展论坛” 天翼云安全能力再获认可
Gbase 8A OLAP analysis function cume_ Example of dist
The create database of gbase 8A takes a long time to query and is suspected to be stuck
MONTHS_BETWEEN函数使用
Oracle obtains the beginning and end of the month time, and obtains the beginning and end of the previous month time
OpenSSL Programming II: building CA
单元测试界的高富帅,Pytest框架,手把手教学,以后测试报告就这么做~
解决本地连接不上虚拟机的问题
Is flush stock trading software reliable?? Is it safe?
九九乘法表——C语言
Golang uses regularity to match substring functions
Deep learning has a new pit! The University of Sydney proposed a new cross modal task, using text to guide image matting


