当前位置:网站首页>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;
}
边栏推荐
猜你喜欢

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

How to install PHP in CentOS

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

Image recognition - Data Cleaning

ZK configuration center -- configuration and use of config Toolkit

vs+qt 设置应用程序图标

个人经历&&博客现状

Difference between redis serialization genericjackson2jsonredisserializer and jackson2jsonredisserializer

How to use pyqt5 to make a sensitive word detection tool

2837xd代码生成模块学习(4)——idle_task、Simulink Coder
随机推荐
三相并网逆变器PI控制——离网模式
Read Day5 30 minutes before going to bed every day_ All key values in the map, how to obtain all value values
每天睡前30分钟阅读Day6_Day6_Date_Calendar_LocalDate_TimeStamp_LocalTime
web安全与防御
BugkuCTF-web16(备份是个好习惯)
Tinyxml2 reading and modifying files
图像识别-数据增广
Timed thread pool implements request merging
Supplier selection and prequalification of Oracle project management system
Methods of classfile
TD联合Modelsim进行功能仿真
QT signal slot summary -connect function incorrect usage
Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedd
2837xd Code Generation - stateflow (4)
Mysql默认事务隔离级别及行锁
Bugkuctf-web21 (detailed problem solving ideas and steps)
Because of hard work, the fruit goes with fate
大学生四六级作文模板(自创版,成功跨过六级)
What are the waiting methods of selenium
View the port of the application published by was