当前位置:网站首页>小青台正式踏上不归路的第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
边栏推荐
- AI周报:允许“员工自愿降薪”;公司回应:员工内心高兴满意;虎牙HR将员工抬出公司;瑞典禁用华为中兴5G设备
- 吐血整理!阿里巴巴 Android 开发手册!(附网盘链接)
- laravel8更新之维护模式改进
- 【Python 1-6】Python教程之——数字
- Returning to the third place in the world, what did Xiaomi do right?
- From a friend recently Ali, Tencent, meituan and other P7 Python development post interview questions
- This paper analyzes the top ten Internet of things applications in 2020!
- Flink from introduction to Zhenxiang (10. Sink data output elasticsearch)
- How to cooperate with people in software development? |Daily anecdotes
- 喝汽水,1瓶汽水1元,2个空瓶可以换一瓶汽水,给20元,可以多少汽水
猜你喜欢

Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom

阿里云加速增长,进一步巩固领先优势

Bccoin tells you: what is the most reliable investment project at the end of the year!

Flink from introduction to Zhenxiang (10. Sink data output elasticsearch)

【Python 1-6】Python教程之——数字

优化if-else代码的八种方案

值得一看!EMR弹性低成本离线大数据分析最佳实践(附网盘链接)

Tight supply! Apple's iPhone 12 power chip capacity exposed

Returning to the third place in the world, what did Xiaomi do right?

The birth of a new integrated memory and computing chip is conducive to the application of artificial intelligence~
随机推荐
Ubuntu20.04 access FTP server garbled problem + upload files
The birth of a new integrated memory and computing chip is conducive to the application of artificial intelligence~
打工人,打工魂,抽终身会员,成为人上人!
Harbor项目高手问答及赠书活动
2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...
laravel8更新之维护模式改进
Major changes in Huawei's cloud: Cloud & AI rises to Huawei's fourth largest BG with full fire
我用 Python 找出了删除我微信的所有人并将他们自动化删除了
浅谈OpenGL之DSA
Drink soda, a bottle of soda water 1 yuan, two empty bottles can change a bottle of soda, give 20 yuan, how much soda can you
laravel8更新之速率限制改进
喝汽水,1瓶汽水1元,2个空瓶可以换一瓶汽水,给20元,可以多少汽水
10 common software architecture patterns
Shell uses. Net objects to send mail
用 Python 写出来的进度条,竟如此美妙~
适合c/c++新手学习的一些项目,别给我错过了!
新型存算一体芯片诞生,利好人工智能应用~
Golang ICMP协议探测存活主机
DeepMind 最新论文解读:首次提出离散概率树中的因果推理算法
Flink从入门到真香(3、从集合和文件中读取数据)