//取余数(%)
#include<iostream>
using namespace std;
int main(){
    int apple=60;            //苹果 
    int people=7;            //人数 
    int apple_remain;        //平分后还剩几个苹果 
    if(people==0)
        cout<<"错误!"<<endl;
    else{
        apple_remain=apple%people; //取余
        cout<<"平均分配后还剩"<<apple_remain<<"个苹果"<<endl;
         
    } 
    return 0;
} 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-22
  • 2022-12-23
  • 2021-12-27
  • 2021-04-01
  • 2021-08-10
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-27
  • 2022-12-23
相关资源
相似解决方案