12 条题解

  • 2
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    int n,m,a,b,c,s2,s3,i;double s1;
    cin>>a>>m>>n;
    s1=m;
    for(i=1;i<=n;i=i+1)
    {
    s1=s1*(1+a*1.0/100);
    }
    s2=floor(s1);
    cout<<s2;
    }
    
    • 0
      @ 2024-6-3 21:39:35
      #include <iostream>
      #include <bits/stdc++.h>
      using namespace std;
      const int N=34354344;
      long double x,k,y;
      int main()
      {
      	cin>>x>>k>>y;
      	x=1+x/100;
      	for(int i=1;i<=y;i++)
      	{
      		k=k*x;
      	}
      	cout<<(int)k;
      	return 0;
      }
      
      
    • 0
      @ 2024-6-1 19:56:55
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
      int n,m,a,b,c,s2,s3,i;double s1;
      cin>>a>>m>>n;
      s1=m;
      for(i=1;i<=n;i=i+1)
      {
      s1=s1*(1+a*1.0/100);
      }
      s2=floor(s1);
      cout<<s2;
      }
      
      
    • 0
      #include <iostream>
      #include <bits/stdc++.h>
      using namespace std;
      const int N=1e7+10;
      const int INF=0x3f3f3f3f;
      long double r,n,y;
      int main()
      {
      	cin>>r>>n>>y;
      	r=1+r/100;
      	for(int i=1;i<=y;i++)
      	{
      		n=n*r;
      	}
      	cout<<(int)n;
      	return 0;
      }
      

      这题有点问题,当数字大一点,答案就是负数(double溢出),输出原本正确的正整数会判定为错

      • -1
        @ 2023-2-10 20:27:48
        #include<bits/stdc++.h>
        
        using namespace std;
        
        int main()
        {
            int n,m,a,b,c,s2,s3,i;double s1;
            cin>>a>>m>>n;
        
            s1=m;
        
            for(i=1;i<=n;i=i+1)
            {
                s1=s1*(1+a*1.0/100);
            }
        
            s2=floor(s1);
            cout<<s2;
        }
        
        • -2
          @ 2023-3-28 21:58:45
          #include <bits/stdc++.h>
          using namespace std;
          const int N = 1e5 + 10;
          const int INF = 0x3f3f3f3f;
          int main(){
          	int r,y;
          	double m;
          	cin >> r >> m >> y;
          	long double x = 1 + r / 100.0;
          	for(int i = 1;i <= y;i++){
          		m = m * x;
          	}
          	cout << int(m);
          	return 0;
          	}
          
          • -3
            @ 2022-10-26 12:23:10
            #include <iostream>
            #include <stack>
            #include <cmath>
            #include <vector>
            #include <string.h>
            #include <queue>
            #include <stdio.h>
            #include <iomanip>
            #include <cstdio>
            #include <algorithm>
            #define int long long
            using namespace std;
            const int N = 1e5 + 10;
            const int INF = 0x3f3f3f3f;
            signed main()
            {
            	double f, x, y;
            	cin >> f >> x >> y;
            	double l = 1.00 + f / 100;
            	for(int i = 1; i <= y; i++)
            	{
            		x *= l;
            	}
            	cout << signed(x) << endl;
            	return 0;
            }
            

            数据还可以让它过

            • -3
              @ 2022-7-9 9:13:07

              #include <stdio.h>

              #include <iostream>

              #include <math.h>

              #include <queue>

              #include <stack>

              #include <vector>

              #include <iomanip>

              using namespace std;

              int main()

              {

              double m,y,r;
              
              cin>>r>>m>>y;
              
              r=1+r/100;
              
              for(int i=1;i<=y;i++)
              
              {
              
              	m*=r;
              
              }
              
              cout<<(int)m<<endl;
              
              return 0;
              

              }

              • -3
                @ 2022-7-9 9:12:21

                /crl(陈儒乐)/

                #include<bits/stdc++.h>//网上查到的万能头//

                using namespace std;

                int main()

                {

                double m,y,r;
                
                cin >> r >> m >> y;
                
                r = 1 + r/100;
                
                for(int i = 1;i <= y;i++)
                
                    m *= r;
                
                cout << (int)m << endl;
                
                return 0;    
                

                }

                • -3
                  @ 2022-2-5 12:09:55
                  #include<iostream>
                  #include<cstdio>
                  #include<cmath>
                  using namespace std;
                  int main()
                  {
                      int n,m,a,b,c,s2,s3,i;double s1;
                      cin>>a>>m>>n;
                      s1=m;
                      for(i=1;i<=n;i=i+1)
                      {
                      s1=s1*(1+a*1.0/100);
                      }
                      s2=floor(s1);
                      cout<<s2;
                  }
                  
                  • -3
                    @ 2022-1-9 15:31:45
                    #include <iostream>
                    #include <math.h>
                    #include <iomanip>
                    using namespace std;
                    #define LL Long Long
                    const int N=1e5+10;
                    const int INF=0x3f3f3f3f;
                    int main() 
                    {
                        int R,M,Y;
                        cin >> R >> M >> Y;
                        int sum = 0;
                        int R (0≤R≤20)
                        int M (100≤M≤1,000,000)
                        int Y (0≤Y≤400)
                        cout << R << M << Y << endl;
                    }```
                    • -3
                      @ 2022-1-8 15:45:27
                      #include<iostream>
                      #include<cstdio>
                      #include<cmath>
                      using namespace std;
                      int main()
                      {
                      int n,m,a,b,c,s2,s3,i;double s1;
                      cin>>a>>m>>n;
                      s1=m;
                      for(i=1;i<=n;i=i+1)
                      {
                      s1=s1*(1+a*1.0/100);
                      }
                      s2=floor(s1);
                      cout<<s2;
                      }
                      
                      
                      • 1

                      信息

                      ID
                      967
                      时间
                      1000ms
                      内存
                      128MiB
                      难度
                      4
                      标签
                      递交数
                      436
                      已通过
                      190
                      上传者