1 solutions

  • 0
    @ 2025-11-5 19:45:57

    C :

    int main(int argc, char* argv[])
    {
    	int a,b;
    	while(~scanf("%d%d",&a,&b))
    	{
    	  printf("%d %d\n",a/b,a%b);
    	}
    	return 0;
    }
    
    

    C++ :

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

    《C语言程序设计》江宝钏主编-习题3-6-商和余

    Information

    ID
    19644
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    (None)
    # Submissions
    0
    Accepted
    0
    Uploaded By