当前位置:网站首页>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;
}
边栏推荐
猜你喜欢
图像识别-数据标注
Vs+qt set application icon
Navicat 远程连接Mysql报错1045 - Access denied for user ‘root‘@‘222.173.220.236‘ (using password: YES)
2837xd 代码生成——StateFlow(2)
Activity的创建和跳转
2837xd code generation module learning (4) -- idle_ task、Simulink Coder
MySQL事务
In depth analysis of how the JVM executes Hello World
Creation and jump of activity
2837xd 代码生成——补充(1)
随机推荐
How to install PHP in CentOS
Image recognition - Data Acquisition
2837xd 代码生成——总结篇
保存视频 opencv::VideoWriter
2837xd 代码生成——StateFlow(1)
Mathematics in machine learning -- point estimation (I): basic knowledge
web安全与防御
C语言之最小数
分享一篇博客(水一篇博客)
Enterprise level SaaS CRM implementation
Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedd
每天睡前30分钟阅读Day6_Day6_Date_Calendar_LocalDate_TimeStamp_LocalTime
Read Day5 30 minutes before going to bed every day_ All key values in the map, how to obtain all value values
Is the C language too fat
Idempotent design of Internet API interface
kinect dk 获取CV::Mat格式的彩色RGB图像(openpose中使用)
Alibaba /热门json解析开源项目 fastjson2
TD conducts functional simulation with Modelsim
2837xd 代码生成——补充(2)
因上努力,果上随缘