F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_39307518_26346.cpp:1:1: error: 'import' does not name a type
    1 | import java.util.*; public class Main { public static void main(String[] args) { Scanner sc_01 = new Scanner(System.in); while (sc_01.hasNext()) { int num_01 = sc_01.nextInt(); ArrayList<Long> arrayList_01 = new ArrayList<Long>(); arrayList_01.add((long) 0); arrayList_01.add((long) 1); if (num_01 != -1) { if(num_01 == 0 ){ System.out.println(arrayList_01.get(0)); }else if(num_01 ==1){ System.out.println(arrayList_01.get(1)); }else { for(int i=2;i<=num_01;i++){ arrayList_01.add(arrayList_01.get(i-1)+arrayList_01.get(i-2)); } System.out.println(arrayList_01.get(arrayList_01.size()-1)); } }else{ break; } } } }
      | ^~~~~~
0_0_39307518_26346.cpp:1:1: note: C++20 'import' only available with '-fmodules-ts', which is not yet enabled with '-std=c++20'
0_0_39307518_26346.cpp:1:21: error: expected unqualified-id before 'public'
    1 | import java.util.*; public class Main { public static void main(String[] args) { Scanner sc_01 = new Scanner(System.in); while (sc_01.hasNext()) { int num_01 = sc_01.nextInt(); ArrayList<Long> arrayList_01 = new ArrayList<Long>(); arrayList_01.add((long) 0); arrayList_01.add((long) 1); if (num_01 != -1) { if(num_01 == 0 ){ System.out.println(arrayList_01.get(0)); }else if(num_01 ==1){ System.out.println(arrayList_01.get(1)); }else { for(int i=2;i<=num_01;i++){ arrayList_01.add(arrayList_01.get(i-1)+arrayList_01.get(i-2)); } System.out.println(arrayList_01.get(arrayList_01.size()-1)); } }else{ break; } } } }
      |                     ^~~~~~


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-30 05:47:49, Gzip enabled