当前位置:网站首页>C language strawberry
C language strawberry
2022-07-02 09:44:00 【FF small confused acridine~】
Four friends went to the picking garden to pick strawberries , I feel very tired after working all morning , I agreed to go to bed first , After waking up, divide these strawberries equally . There is a man who wakes up early , I waited for a while and didn't see anyone else coming , I took a strawberry and ate it first , I waited for a while and didn't see anyone else coming , Divide the remaining strawberries into four equal parts ( Exactly equal ), Took one of them . Then the second man woke up , I also ate a strawberry first , But he didn't know that someone had taken some strawberries , Just divide the remaining strawberries into four parts ( Exactly equal ), Took one of them . Then the third person 、 The fourth person is the same . How many strawberries are there in this pile ?
Programming , Output 10 Set the value that meets the requirements of the topic , The requirements must start from the minimum value that meets the requirements of the topic , In turn increase , Other values that meet the requirements cannot be skipped , Each value takes up one line . If the minimum value meeting the requirements is 253, The second decimal value that meets the requirements is 509,……, The output of :
253
509
……
Programming requirements :
1、 Please use the circular method to realize ;
2、 When submitting the code of the task, it is necessary to ensure that it conforms to the industry code specification , You need to indent and wrap as necessary .( Affect the performance evaluation )
#include <stdio.h>
int main(void)
{
int n;
int c = 0;
for(n = 1;;n++){
if((n-1)%4 == 0)
if(((n-1)*3/4-1)%4 == 0)
if((((n-1)*3/4-1)*3/4-1)%4 == 0)
if(((((n-1)*3/4-1)*3/4-1)*3/4-1)%4 == 0){
printf("%d\n",n);
c++;
if(c > 9)
break;
}
}
return 0;
}
#include <stdio.h>
int main(void)
{
int i,a,b,c,d;
i=0;
a=6;
while(i<10){
b=(a-1)*3/4;
c=(b-1)*3/4;
d=(c-1)*3/4;
if((a-1)%4==0 && (b-1)%4==0 && (c-1)%4==0 && (d-1)%4==0){
printf("%d\n",a);
i+=1;
}
a+=1;
}
return 0;
}
边栏推荐
- JDBC review
- 2837xd 代码生成——StateFlow(1)
- 图像识别-数据标注
- 每天睡前30分钟阅读Day5_Map中全部Key值,全部Value值获取方式
- 2837xd 代码生成——StateFlow(4)
- Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedd
- How to use pyqt5 to make a sensitive word detection tool
- Bugkuctf-web16 (backup is a good habit)
- Tools used for Yolo object recognition and data generation
- YOLO物体识别,生成数据用到的工具
猜你喜欢

记录一下初次使用Xray的有趣过程

JDBC回顾

In SQL injection, why must the ID of union joint query be equal to 0

Supplier selection and prequalification of Oracle project management system

图像识别-数据清洗

BugkuCTF-web21(详细解题思路及步骤)

图像识别-数据标注

三相并网逆变器PI控制——离网模式

Off grid control of three-phase inverter - PR control

Redis 序列化 GenericJackson2JsonRedisSerializer和Jackson2JsonRedisSerializer的区别
随机推荐
Cmake command - Official Document
自定义Redis连接池
企业级SaaS CRM实现
Elastic Stack之Beats(Filebeat、Metricbeat)、Kibana、Logstash教程
Hystrix implements request consolidation
BugkuCTF-web16(备份是个好习惯)
Record the interesting process of using Xray for the first time
How to use pyqt5 to make a sensitive word detection tool
idea查看字节码配置
Chrome user script manager tempermonkey monkey
ZK configuration center -- configuration and use of config Toolkit
Knife4j 2. Solution to the problem of file control without selection when uploading x version files
What is the function of laravel facade
Typora安装包分享
记录一下初次使用Xray的有趣过程
Navicat remote connection MySQL reports an error 1045 - access denied for user 'root' @ '222.173.220.236' (using password: yes)
College Students' CET-4 and CET-6 composition template (self created version, successfully crossed CET-6)
自定義Redis連接池
2837xd 代码生成——补充(3)
Beats (filebeat, metricbeat), kibana, logstack tutorial of elastic stack