2 条题解

  • 1
    @ 2025-5-17 11:28:25

    简单!

    只要判断一下 n 的值就行了!

    #include <bits/stdc++.h>
    using namespace std;
    long long n;
    int main(){
    	cin >> n;
    	if(n == 1 || n == 0) cout << "Today, I ate " << n << " apple.";
    	else cout << "Today, I ate " << n << " apples.";
    	return 0;
    }
    
    
    
    • 0

      #include<bits/stdc++.h> #include using namespace std; int main() { int x; cin>>x; if(x0) { cout<<"Today, I ate 0 apple."; } if(x1) { cout<<"Today, I ate 1 apple."; } if(x>1) { cout<<"Today, I ate "<<x<<" apples."; } return 0; } //自己换行,我已经尽力了!!!

      • 1

      信息

      ID
      9734
      时间
      1000ms
      内存
      125MiB
      难度
      1
      标签
      (无)
      递交数
      96
      已通过
      63
      上传者