POJ3980 取模运算【水题】

取模运算

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

问题链接POJ3980 取模运算
问题描述:(略)
问题分析:极其简单的水题, 模除一下就好。
程序说明:(略)
参考链接:(略)
题记:虽然说功能要封装到函数以便复用,过于简单的功能也就没有必要封装。

AC的C语言程序如下:

/* POJ3980 取模运算 */

#include <stdio.h>

int main(void)
{
    int a, b;

    while(~scanf("%d%d", &a, &b))
        printf("%d\n", a % b);

    return 0;
}

猜你喜欢

转载自blog.csdn.net/tigerisland45/article/details/84935463