if(a!=0) (a%c==0)?cout< else return 0;
這樣也可以:
#include<iostream>using namespace std;int main(){ int m,t; cin>>m; while(cin>>t, t!=0){ if(t%m==0) cout<<t/m<<"\n"; else cout<<m-(t%m)<<"\n"; }}