当前位置:网站首页>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;
}
边栏推荐
- 2837xd 代码生成——总结篇
- Alibaba /热门json解析开源项目 fastjson2
- Bugkuctf-web21 (detailed problem solving ideas and steps)
- BugkuCTF-web24(解题思路及步骤)
- ZK configuration center -- configuration and use of config Toolkit
- Read 30 minutes before going to bed every day_ day4_ Files
- Thinkphp5 how to determine whether a table exists
- Int to string, int to qstring
- How to use pyqt5 to make a sensitive word detection tool
- Timed thread pool implements request merging
猜你喜欢

Idempotent design of Internet API interface

How to use pyqt5 to make a sensitive word detection tool

Chrome user script manager tempermonkey monkey

PI control of three-phase grid connected inverter - off grid mode

Learn combinelatest through a practical example

Tools used for Yolo object recognition and data generation

Mysql 多列IN操作

Typora installation package sharing

分享一篇博客(水一篇博客)

图像识别-数据清洗
随机推荐
保存视频 opencv::VideoWriter
idea查看字节码配置
Knife4j 2. Solution to the problem of file control without selection when uploading x version files
图像识别-数据采集
Share a blog (water blog)
YOLO物体识别,生成数据用到的工具
Customize redis connection pool
Int to string, int to qstring
Binary and decimal system of C language
Image recognition - data annotation
Because of hard work, the fruit goes with fate
Timed thread pool implements request merging
C语言之到底是不是太胖了
College Students' CET-4 and CET-6 composition template (self created version, successfully crossed CET-6)
Navicat 远程连接Mysql报错1045 - Access denied for user ‘root‘@‘222.173.220.236‘ (using password: YES)
TD conducts functional simulation with Modelsim
Methods of classfile
2837xd 代碼生成——補充(1)
Navicat remote connection MySQL reports an error 1045 - access denied for user 'root' @ '222.173.220.236' (using password: yes)
How to choose between efficiency and correctness of these three implementation methods of distributed locks?