⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 multiplication.c

📁 People have vast background knowledge to cope with everyday situations. We don t have to be told e
💻 C
字号:
#include <stdio.h>#include <stdlib.h>#include <stdbool.h>int main(void){    for (int a = 100; a < 1000; ++a)        for (int b = 10; b < 100; ++b) {            int result = b * a;            if (b * a >= 100000)                continue;            int m1 = a / 100;            int m2 = a / 10 % 10;            int m3 = a % 10;            int n1 = b / 10;            int n2 = b % 10;            int product1 = a * n2;            int product2 = a * n1;            if (product1>7777&&product2>7777&&result>77777)                continue;            int p11 = product1 / 1000;            int p12 = product1 / 100 % 10;            int p13 = product1 / 10 % 10;            int p14 = product1 % 10;            int p21 = product2 / 1000;            int p22 = product2 / 100 % 10;            int p23 = product2 / 10 % 10;            int p24 = product2 % 10;            int r1=result / 10000;            int r2=result / 1000 % 10;            int r3=result / 100 % 10;            int r4=result / 10 % 10;            int r5=result % 10;            if (m1==0||m1==1||m1==4||m1==6||m1==8||m1==9)                continue;            if (m2==0||m2==1||m2==4||m2==6||m2==8||m2==9)                continue;            if (m3==0||m3==1||m3==4||m3==6||m3==8||m3==9)                continue;            if (n1==0||n1==1||n1==4||n1==6||n1==8||n1==9)                continue;            if (n2==0||n2==1||n2==4||n2==6||n2==8||n2==9)                continue;            if (p11==0||p11==1||p11==4||p11==6||p11==8||p11==9)                continue;            if (p12==0||p12==1||p12==4||p12==6||p12==8||p12==9)                continue;            if (p13==0||p13==1||p13==4||p13==6||p13==8||p13==9)                continue;            if (p14==0||p14==1||p14==4||p14==6||p14==8||p14==9)                continue;            if (p21==0||p21==1||p21==4||p21==6||p21==8||p21==9)                continue;            if (p22==0||p22==1||p22==4||p22==6||p22==8||p22==9)                continue;            if (p23==0||p23==1||p23==4||p23==6||p23==8||p23==9)                continue;            if (p24==0||p24==1||p24==4||p24==6||p24==8||p24==9)                continue;            if (r1==0||r1==1||r1==4||r1==6||r1==8||r1==9)                continue;            if (r2==0||r2==1||r2==4||r2==6||r2==8||r2==9)                continue;            if (r3==0||r3==1||r3==4||r3==6||r3==8||r3==9)                continue;            if (r4==0||r4==1||r4==4||r4==6||r4==8||r4==9)                continue;            if (r5==0||r5==1||r5==4||r5==6||r5==8||r5==9)                continue;            printf("%d x %d = %d, with %d, %d as partial products, is a solution.\n",                   a, b, result, product1, product2);        }    return EXIT_SUCCESS;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -