10 条题解

  • 1
    @ 2024-2-20 10:25:53
    #include<iostream> 
    using namespace std;
    int main(){
    	int a,b;
    	cin>>a>>b;
    	cout<<a/b<<" "<<a%b;
    	return 0;
    }
    
    • 1
      @ 2023-10-7 11:37:02

      本题主要考察整除(/)和取余(%)运算。

      根据题意思路为:首先定义两个int整型数,输入两个整型数,输出整除结果,输出空格,输出取余结果。

      参考代码如下:

      #include<iostream> 
      using namespace std;
      int main(){
      	int a,b;
      	cin>>a>>b;
      	cout<<a/b<<" "<<a%b;
      	return 0;
      }
      
      • 0
        @ 2024-2-22 11:13:49
        #include<iostream> 
        using namespace std;
        int main(){
        	int a,b;
        	cin>>a>>b;
        	cout<<a/b<<" "<<a%b;
        	return 0;
        }
        
        • 0
          @ 2024-2-22 9:44:48
          #include<iostream> 
          using namespace std;
          int main(){
          	int a,b;
          	cin>>a>>b;
          	cout<<a/b<<" "<<a%b;
          	return 0;
          }
          
          • 0
            @ 2024-2-21 21:23:47

            #include using namespace std; int main(){ int a,b; cin>>a>>b; cout<<a/b<<" "<<a%b; return 0; }

            • 0
              @ 2024-2-20 12:23:44

              #include using namespace std; int main(){ int a,b,c,d; cin>>a>>b; c=a%b; d=a/b; cout<<d<<" "<<c; return 0; }

              • 0
                @ 2024-2-20 11:31:46

                #include using namespace std; int main(){ int a,b; cin>>a>>b; cout<<a/b<<" "<<a%b; return 0; }

                • 0
                  @ 2024-2-20 11:13:53

                  #include using namespace std; int main(){ int a,b,c; cin>>a>>b; c=a%b; cout<<c; return 0; }

                  • 0
                    @ 2024-2-20 10:36:15
                    #include<iostream> 
                    using namespace std;
                    int main(){
                    	int a,b,c,d;
                    	cin>>a>>b;
                    	c=a/b;
                    	d=a%b;
                    	cout<<c<<" "<<d;
                    	return 0;
                    }
                    
                    • 0
                      @ 2024-2-20 10:25:35

                      #include using namespace std; int main(){ int a,b,c; cin>>a>>b; c=a%b; cout<<c; return 0; }

                    • 1

                    信息

                    ID
                    60
                    时间
                    1000ms
                    内存
                    128MiB
                    难度
                    3
                    标签
                    (无)
                    递交数
                    783
                    已通过
                    420
                    上传者