- Beranda
- Programmer Forum
Toki learning wrong answer
...
TS
faiz88
Toki learning wrong answer
ini jawaban ane:
ini soal toki learningnya: https://training.ia-toki.org/problem...9/problems/24/
apa yang salah ya gan? kalo ane coba di netbeans contoh input dan output sama persis. terimakasih. berhadiah
Code:
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.util.Scanner;
/**
*
* @author User
*/
public class LatihanToki {
/**
* @param args the command line arguments
*/
static void checkGB(int total_usage, int case_no){
case_no++;
if(total_usage<16000)
System.out.println("Case #"+case_no+": 16GB");
else if(total_usage<32000)
System.out.println("Case #"+case_no+": 32GB");
else if (total_usage<64000)
System.out.println("Case #"+case_no+": 64GB");
else if (total_usage<128000)
System.out.println("Case #"+case_no+": 128GB");
}
public static void main(String[] args) {
// TODO code application logic here
int no_case;
int no_app;
int total;
Scanner x= new Scanner(System.in);
//System.out.print("Banyak case: ");
no_case = x.nextInt();
int[]each_case = new int[no_case];
for(int i=0;i<no_case;i++){
each_case[i]=0;
//System.out.print("Case "+i+" \nBanyak Aplikasi : ");
no_app = x.nextInt();
for(int j=1;j<=no_app;j++){
//System.out.print("Storage app "+j+" : ");
each_case[i]+=x.nextInt();
}
}
for(int i=0;i<no_case;i++){
checkGB(each_case[i],i);
}
}
}
ini soal toki learningnya: https://training.ia-toki.org/problem...9/problems/24/
Spoiler for soal:
apa yang salah ya gan? kalo ane coba di netbeans contoh input dan output sama persis. terimakasih. berhadiah
Diubah oleh faiz88 23-06-2018 13:10
nona212 memberi reputasi
1
609
2
Guest
Tulis komentar menarik atau mention replykgpt untuk ngobrol seru
Mari bergabung, dapatkan informasi dan teman baru!
Programmer Forum
20.2KThread•4.2KAnggota
Terlama
Guest
Tulis komentar menarik atau mention replykgpt untuk ngobrol seru