当前位置:网站首页>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;
}
边栏推荐
- Mysql默认事务隔离级别及行锁
- 自定義Redis連接池
- 2837xd Code Generation - stateflow (4)
- CKEditor 4.10.1 上传图片提示“不正确的服务器响应” 问题解决
- Image recognition - Data Cleaning
- Discussion on improving development quality and reducing test bug rate
- Methods of classfile
- FragmentTabHost实现房贷计算器界面
- Alibaba / popular JSON parsing open source project fastjson2
- Timed thread pool implements request merging
猜你喜欢

Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedd

Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedd

Image recognition - data annotation

自定義Redis連接池

自定义Redis连接池

个人经历&&博客现状

How to use PHP spoole to implement millisecond scheduled tasks

Don't look for it. All the necessary plug-ins for Chrome browser are here

Operation and application of stack and queue

上班第一天的报错(AWVS卸载不彻底)
随机推荐
2837xd 代碼生成——補充(1)
Error reporting on the first day of work (error reporting when Nessus installs WinPcap)
Alibaba / popular JSON parsing open source project fastjson2
图像识别-数据清洗
In SQL injection, why must the ID of union joint query be equal to 0
自定义Redis连接池
Chrome browser plug-in fatkun installation and introduction
tinyxml2 读取和修改文件
2837xd Code Generation - Supplement (1)
Insight into cloud native | microservices and microservice architecture
Microservice practice | Eureka registration center and cluster construction
Amq6126 problem solving ideas
C语言之做木桶
2837xd 代码生成——StateFlow(3)
zk配置中心---Config Toolkit配置与使用
Methods of classfile
ClassFile - Attributes - Code
web安全与防御
Beats (filebeat, metricbeat), kibana, logstack tutorial of elastic stack
互联网API接口幂等设计