当前位置:网站首页>小青台正式踏上不归路的第3天
小青台正式踏上不归路的第3天
2020-11-08 13:52:00 【osc_3vp99iw6】
小青台正式踏上不归路的第3天
看看之前的笔记
再看看现在的水平
不禁流下悔恨的泪水
做个作业做的兴(抓)致(耳)勃(挠)勃(腮)
恨不得拔光头发
屁话真多
好了我要记录每一道明明简单我就是做不出来的题TAT
- 给定两个数,求这两个数的最大公约数
<我讨厌公约数>
#include <stdio.h>
int main()
{
int a,b,c,i;
scanf("%d%d",&a,&b);
if (a < b)
{
c = a; a = b; b = c;
}
for (i = b;i <= a; i--)
{
if (a % i == 0 && b % i == 0)
{
printf("最大公约数为:");
printf("%d\n",i);
break;
}
}
return 0;
}
- 打印1000年到2000年之间的闰年
<我还讨厌闰年>
#include <stdio.h>
int main()
{
int i;
printf("区间闰年有:");
for(i=1000;i<2001;i+=4)
{
if(i%4==0)
{
printf("%d\n",i);
}
}
return 0;
}
- 计算1/1-1/2+1/3-1/4+1/5 …… + 1/99 - 1/100 的值,打印出结果
<做这道题属实用了快40min我是石头>
计算1/1-1/2+1/3-1/4+1/5 …… + 1/99 - 1/100 的值,打印出结果
#include <stdio.h>
int main()
{
int i;
float sum=1;
printf("所求项目之和为:");
for(i=2;i<=100;i++)
{
if(i%2==0)
{
sum+=-1.0/i;
}
else{
sum+=1.0/i;
}
}
printf("%f\n",sum);
return 0;
}
- 1到 100 的所有整数中出现多少个数字9
#include <stdio.h>
int main()
{
int i,j=0;
printf("数字9的个数有:");
for(i=1;i<101;i++)
{
if(i%10==9)
{
j++;
}
}
printf("%d",j);
return 0;
}
- 打印100~200之间的素数
<素数=变态数>
#include <stdio.h>
int main()
{
int i,j;
printf("区间素数有:");
for(i=100;i<=200;i++)
{
for(j=2;j<i;j++)
{
if(i%j==0)
{
break;
}
}
if(i==j)
{
printf("%d\n",i);
}
}
return 0;
}
- 在屏幕上输出99乘法口诀表
#include<stdio.h>
int main()
{
int i=0;
for(i=1;i<=9;i++)
{
int j=0;
for(j=1;j<=i;j++)
{
printf("%d*%d=%d ",i,j,i*j);
}
printf("\n");
}
return 0;
}
- 求10 个整数中最大值
#include <stdio.h>
int main()
{
int a[11],i;
for(i=1;i<=10;i++)
{
scanf("%d",&a[i]);
}
a[0]=a[1];
for(i=1;i<=10;i++)
{
if(a[i]>=a[0]) a[0]=a[i];
}
printf("最大值为:");
printf("%d\n",a[0]);
return 0;
}
总耗时120min;
总error n次;
总崩溃 n+1次;
版权声明
本文为[osc_3vp99iw6]所创,转载请带上原文链接,感谢
https://my.oschina.net/u/4307541/blog/4708183
边栏推荐
- 金融领域首个开源中文BERT预训练模型,熵简科技推出FinBERT 1.0
- AQS解析
- laravel8更新之速率限制改进
- Alibaba cloud accelerates its growth and further consolidates its leading edge
- 模板引擎的整理归纳
- Flink从入门到真香(10、Sink数据输出-Elasticsearch)
- 三、函数的参数
- 10 common software architecture patterns
- This paper analyzes the top ten Internet of things applications in 2020!
- Essential for back-end programmers: distributed transaction Basics
猜你喜欢
On the software of express delivery cabinet and deposit cabinet under Windows
CSP考试须知与各种小技巧
Or talk No.19 | Facebook Dr. Tian Yuandong: black box optimization of hidden action set based on Monte Carlo tree search
Python基础语法
重返全球第三,小米做对了什么?
Flink从入门到真香(10、Sink数据输出-Elasticsearch)
值得一看!EMR弹性低成本离线大数据分析最佳实践(附网盘链接)
Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
This paper analyzes the top ten Internet of things applications in 2020!
我们做了一个医疗版MNIST数据集,发现常见AutoML算法没那么好用
随机推荐
TiDB 性能竞赛 11.02-11.06
Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
Enabling education innovation and reconstruction with science and technology Huawei implements education informatization
The most complete! Alibaba economy cloud original practice! (Internet disk link attached)
分布式文档存储数据库之MongoDB基础入门
AQS analysis
AI周报:允许“员工自愿降薪”;公司回应:员工内心高兴满意;虎牙HR将员工抬出公司;瑞典禁用华为中兴5G设备
PMP考试通过心得分享
我用 Python 找出了删除我微信的所有人并将他们自动化删除了
laravel8更新之速率限制改进
The first open source Chinese Bert pre training model in the financial field
2035 we will build such a country
Restfulapi learning notes -- father son resources (4)
PMP experience sharing
一文读懂机器学习“数据中毒”
2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...
软件开发中如何与人协作? | 每日趣闻
浅谈单调栈
Major changes in Huawei's cloud: Cloud & AI rises to Huawei's fourth largest BG with full fire
Flink from introduction to Zhenxiang (7. Sink data output file)