How to write a program that inputs 10 numbers and outputs the maximum max 10

Updated on educate 2024-05-14
12 answers
  1. Anonymous users2024-02-10

    import ;

    import ;

    public class maxno

    public static void main(string args)

    int num = new int[10];

    scanner scanner = new scanner(;

    for(int i=0;i<10;i++)"Please enter section"+(i+1)+"number");

    num[i] = ;

    The maximum number is"+num[9]);

  2. Anonymous users2024-02-09

    The key question is, what language do you want to do this?

  3. Anonymous users2024-02-08

    Read in 10 integers and output those 10 numbers.

    #include

    using namespace std;

    int main(void)

  4. Anonymous users2024-02-07

    #include

    #include

    #include

    #include

    #include

    using namespace std;

    int main(void)

    int str[11];

    cout<<"Please enter 10 numbers separated by spaces";

    for(int a=0;a<10;a++)cin>>str[a];

    for(int a=0;a<10;a++)cout<< str[a] <""<

  5. Anonymous users2024-02-06

    numbers is the name of the array, that is, the address of the source element that comes from the first element of the array. bainumbers+j is the address zhi of the j-th element du, and *(numbers+j) is the value of the j-th element. where * is the meaning of the data in memory that the pointer of the DAO surface points to, and the point+ integer number refers to the address of the multiple elements that the pointer points to the integer number backwards.

    For example, here int numbers[10]=; Then numbers+2 points to 2, and * (numbers+2) is 2.

  6. Anonymous users2024-02-05

    This is the usage of the pointer, which means that the value stored in the memory is offset by i int size from the beginning of numbers, + is the offset, and * is the value of the address pointing to the data stored in the memory.

    Equivalent to if(numbers i] == value).

  7. Anonymous users2024-02-04

    I want to ask why you are not wrong? a is an array, for ( i = 0; i <10; i++)

    After this for loop, the value of i is already 10. Not only for a transgression, but also for the maximum value is not a[10].if(max will be updated each time, and if a[i] is greater than the current maximum, the maximum value will be updated to a[i].

  8. Anonymous users2024-02-03

    static void main(string args)int temp = 0;

    int sum = 0;

    The following loop is to first sort the array in descending order (bubbling sort), then set the first value as the maximum value and the last value as the minimum value.

    for (int i = 0; i < 9; i++)sum += arr[i];

    The largest number is:"+arr[0]);

    The minimum number is:"+arr[9]);

    The average is:"+sum/10);;

  9. Anonymous users2024-02-02

    Don't know what error you're prompting.

    The second for should be.

    for ( i = 0; i <;i++)"The largest of the 10 numbers is",max );

  10. Anonymous users2024-02-01

    When you last output, i=9, so a[i]=a; Of course not.

  11. Anonymous users2024-01-31

    I also agree with the words on the first floor.,Are you studying like this?。。 If you still need to ask about this, I advise you to give up programming as soon as possible.

  12. Anonymous users2024-01-30

    Generally speaking, your platform is a 16-bit int, so when you enter the 123456, it becomes negative because it exceeds the range of int, and 1 is of course larger than a negative number.

Related questions
10 answers2024-05-14

Find the common divisor like two numbers m and n

r=m%n; >>>More

14 answers2024-05-14

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

7 answers2024-05-14

The amount of data is so small, you don't need to arrange it quickly, it's a waste, just a two-fold for loop can be done, the procedure is as follows: >>>More

17 answers2024-05-14

Note: It can be found using simple multiplication rules.

There are 3 kinds of single digits, 4 kinds of 100 digits when the 10 digit is 0, and 3 kinds of 100 digits when the 10 digit is non-0 (the 100 digit cannot be equal to 0). >>>More

5 answers2024-05-14

Just use an array.

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