-
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]);
-
The key question is, what language do you want to do this?
-
Read in 10 integers and output those 10 numbers.
#include
using namespace std;
int main(void)
-
#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] <""<
-
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.
-
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).
-
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].
-
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);;
-
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 );
-
When you last output, i=9, so a[i]=a; Of course not.
-
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.
-
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.
Find the common divisor like two numbers m and n
r=m%n; >>>More
The specific process is as Richardbao2000 said: 1, read 10 numbers. >>>More
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
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
Just use an array.
var a:array[1..1000]of longint; >>>More