Enter 3 numbers, output the largest common divisor number, and program to complete the task 10

Updated on educate 2024-04-13
10 answers
  1. Anonymous users2024-02-07

    Find the common divisor like two numbers m and n

    r=m%n;

    while(r)

    m=n;n=r;

    r=m%n;

    return n;

    For three numbers, find the greatest common divisor n of the first two numbers, and then find the greatest common divisor with the third number.

  2. Anonymous users2024-02-06

    #include

    main()

    If (*a < c) builds on the first comparison and ensures that a is the largest of the three numbers.

    printf("%d", *a);Output Maximum}

  3. Anonymous users2024-02-05

    That's how it is written.

    You can also change it to a macro definition define max(a,b) (a>b ?a: b).

    #include

    #include

    void main()

    printf("the number with maximum absolute value is %d", a[0]>a[1] ?a[0] :a[1]) a[2] ?

    a[0]>a[1] ?a[0] :a[1]) a[2] )

    The macro definition replaces printf("%d",max(max(a[0],a[1]),a[2]))

  4. Anonymous users2024-02-04

    If it is decimal, then the largest is 999, if it is hexadecimal, then the largest is FFF, and if it is infinity, then it is

  5. Anonymous users2024-02-03

    If the three integers of abc are equal, the maximum number output is 999;

    If the three integers of abc are not equal, the largest number output is 987;

    Note: The numbers on the keyboard are from 0-9, which means that you can choose 3 integer combinations from these 10 integers and choose the largest number. The question does not say whether the three numbers of ABC can be the same, so two cases are chosen, the first is equal and the second is not equal at all.

    There is no supplementary problem with the refresh just now.,If it's a computer language.,It means I don't understand.,Please add it to the teacher.。

  6. Anonymous users2024-02-02

    The bubbling algorithm is very simple, set a value, assign the value of the first number to him, and then use if to make a comparison of 3 numbers, if there are more numbers, just use a loop.

  7. Anonymous users2024-02-01

    I guess two functions can be called. One is the exchange and the other is to find the maximum function max.

  8. Anonymous users2024-01-31

    The key is to know the way of thinking. The combination of the above two is comprehensive.

  9. Anonymous users2024-01-30

    a,b is compared, the larger assignment is given to a,a,c for comparison, and the larger assignment is given to a, and a is output

  10. Anonymous users2024-01-29

    Follow the process below:

    1 Enter three numbers.

    2 Assign the maximum and minimum variables to the first number.

    3 Compare the maximum minimum with the remaining two numbers, and if it is larger or smaller, replace it with what is called the maximum minimum.

    4 Outputs. ** Below:

    #include

    int main()

Related questions
14 answers2024-04-13

The specific process is as Richardbao2000 said: 1, read 10 numbers. >>>More

5 answers2024-04-13

Just use an array.

var a:array[1..1000]of longint; >>>More

31 answers2024-04-13

The question you are talking about belongs to permutations and combinations and simple number theory. >>>More

11 answers2024-04-13

The hottest dog day mystery is the number 3. Whether it's dog days or thirty-nine days, three falls, three numbers, three months, the numbers are all 3.

14 answers2024-04-13

> 101, so you can write up to 13 numbers.

odd number + one even number = even number, impossible; >>>More