1 solutions

  • 0
    @ 2025-11-5 17:31:03

    C :

    #include <stdio.h>
    
    int main(void) {
    	int a, b = 0, c;
    	scanf("%d", &a);
    	while(b == 0)
    		scanf("%d", &b);
    	c = a % b;
    	printf("%d", c);
    	return 0;
    }
    
    

    C++ :

    #include<cstdio>
    using namespace std;
    int main()
    {
    	int a,b,s;
    	scanf("%d%d",&a,&b);
    	s=a%b;
    	printf("%d\n",s);
    	return 0;
    }
    

    Pascal :

    program yucong;
    var
    a,b,s:integer;
    begin
    read(a,b);
    s:=a mod b;
    writeln(s);
    readln;
    end.
    
    • 1

    第一章:整数运算《练习4:整数模运算(求余数)》

    Information

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