mirror of
https://github.com/Microsoft/MS-DOS.git
synced 2025-08-19 21:13:33 -07:00
Create code.java
This commit is contained in:
parent
b297ae5788
commit
df324154ce
1 changed files with 42 additions and 0 deletions
42
v2.0/source/code.java
Normal file
42
v2.0/source/code.java
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
import java.util.*;
|
||||||
|
class chefSum
|
||||||
|
{
|
||||||
|
public static void main(String [] args)
|
||||||
|
{
|
||||||
|
Scanner sc=new Scanner(System.in);
|
||||||
|
int n=sc.nextInt();
|
||||||
|
int v[]=new int[n];
|
||||||
|
for(int i=0;i<n;i++)
|
||||||
|
{
|
||||||
|
int x=sc.nextInt();
|
||||||
|
int arr[]=new int[x];
|
||||||
|
for(int j=0;j<x;j++)
|
||||||
|
arr[j]=sc.nextInt();
|
||||||
|
int min=arr[0];
|
||||||
|
int index=0;
|
||||||
|
for(int j=0;j<x;j++)
|
||||||
|
{
|
||||||
|
if(arr[j]<min)
|
||||||
|
{
|
||||||
|
min=arr[j];
|
||||||
|
index=j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
v[i]=index+1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
for(int l=0;l<n;l++)
|
||||||
|
System.out.println(v[l]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue