{primary} 程序必须有返回值
#include <stdio.h>
using namespace std;
int main()
{
int a,b;
scanf("%d%d",&a,&b);
a = a>b?a:b;
while(a--){
printf("HelloWorld");
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
a = a>b?a:b;
while(a--){
cout << "HelloWorld!" << endl;
}
return 0;
}
{danger} Java语言中,对主类前不能加public修饰符
import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
int result = 0;
for(int i = 0; i < n; i++){
if(isPrime(Integer.parseInt(sc.next()))) result++;
}
System.out.println(result);
}
}