取模运算
Time Limit: 1000MS   Memory Limit: 65536K
Total Submissions: 7836   Accepted: 4806

Description

编写一个C函数mod(int n, int m),实现取模运算%

Input

输入包含多行数据 

每行数据是两个整数a, b (1 <= a, b <= 32767) 
数据以EOF结束

Output

于输入的每一行输出a%b

Sample Input

5 3
100 2

Sample Output

2
0
View Code
#include<stdio.h>
int main()
{
    int a,b;
    while(scanf("%d%d",&a,&b)!=EOF)
    printf("%d\n",a%b);
    return 0;
}

相关文章:

  • 2021-06-08
  • 2021-05-29
  • 2021-11-19
  • 2022-12-23
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案