2 solutions

  • 3
    @ 2024-11-17 21:02:55
    #include<bits/stdc++.h>
    typedef long long ll;
    using namespace std;    
    const int N=10010;
    double a;
    int main(){
    	
    	cin.sync_with_stdio(false);
    	ios::sync_with_stdio(0);	
        cin>>a;
        if (a<=150)
            printf("%.1lf",a*0.4463);
        else if (a>=151 && a<=400)
            printf("%.1lf",150*0.4463+(a-150)*0.4663);
        else
        	printf("%.1lf",150*0.4463+250*0.4663+(a-400)*0.5663);
        
        
        return 0;
    }
    
    • 1
      @ 2024-10-29 17:05:19
      #include <cstdio>
      using namespace std;
      int n;
      double a,b,c;
      int main()
      {
      cin>>n;
      if(n<150)
      {
      a=n*0.4463;
      printf("%.1f",a);
      }
      else if(n<400)
      {
      b=150*0.4463+(n-150)*0.4663;
      printf("%.1f",b);
      }
      else
      {
      c=150*0.4463+250*0.4663+(n-400)*0.5663;
      printf("%.1f",c);
      }
      return 0;
      }
      

      #include <bits/stdc++.h> #include using namespace std; int n; double a,b,c; int main() { cin>>n; if(n<150) { a=n0.4463; printf("%.1f",a); } else if(n<400) { b=1500.4463+(n-150)0.4663; printf("%.1f",b); } else { c=1500.4463+250*0.4663+(n-400)*0.5663; printf("%.1f",c); } return 0; }

      
      
      • 1

      Information

      ID
      408
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      6
      Tags
      (None)
      # Submissions
      144
      Accepted
      48
      Uploaded By