欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

数位拆分v1.0

程序员文章站 2024-03-19 11:42:46
...

数位拆分v1.0

#include "stdio.h"
#include "math.h"
int main() {
    int n = 4321;
    int a = n / 100, b = n % 100;
    printf("a=%d,b=%d\n", a, b);
    printf("a+b=%d\n", a + b);
    printf("a-b=%d\n", a - b);
    printf("a*b=%d\n", a * b);
    printf("a/b=%.2f\n", a*1.0/b);
    printf("a%%b=%d\n", a%b);
    return 0;
}