求大佬帮助!!(80)

P1150 Peter 的烟

Michael123456 @ 2017-09-24 19:52:59

#include<bits/stdc++.h>
using namespace std;
long long n,a[1000000];long long sum,s;
int main()
{
    ios::sync_with_stdio(false);
    scanf("%lld%lld",&n,&s);
    sum=n/s+n;
    printf("%lld",sum);
    return 0;
}

by onepunchman @ 2017-09-28 21:11:59

#include<bits/stdc++.h>
using namespace std;
int main()
{
   int i,n,k,s;
   cin>>n>>k;
   s=0;
   for(i=1;i<=n;i++)
   {
         s++;
         if(s==k&&k!=1)
         {
             n++;
             s=0;
       }
   }
   cout<<n;
   return 0;
}

by awask @ 2017-10-24 16:15:35

#include<iostream>
using namespace std;
int main()
{
    int a,b,c=0;
    int d=0;
    cin>>a>>b;
    c+=a;
    d+=a;
    while(d>=b)
    {
        d-=b;
        c++;
        d++;
    }
    cout<<c;
    return 0;
}

|