dotcpp


私信TA

用户名:dotcpp0607606

访问量:555

签 名:

等  级
排  名 209
经  验 6237
参赛次数 13
文章发表 1
年  龄 18
在职情况 学生
学  校
专  业

  自我简介:

解题思路:  要首先算出n有多少个7天,然后就有剩下的小于7天的了。

注意事项:

参考代码:

#include<bits/stdc++.h>

using namespace std;

int main()

{

long long a,b,n;

cin>>a>>b>>n;

long long s=0;

long long  sum=a*5+b*2;

s=n/sum;

long long  x=n%sum;

long long  cnt=s*7;

long long  k=1;

while(x>0)

{

if(k<=5)

{

cnt++;

k++;

x-=a;

}else{

cnt++;

x-=b;

}

}

cout<<cnt;

return 0;

 } 


 

0.0分

3 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答

代码解释器

  评论区