submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s250348028 | p00433 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main () {
int ans;
int a,b;
int S=0,T=0;
for(int i=0;i<4;i++){
cin>>a;
S+=a;
}
for(int j==0;j<4;j++){
cin>>b;
T+=b;
}
ans=max(S,T);
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:19: error: expected ';' before '==' token
12 | for(int j==0;j<4;j++){
| ^~
| ;
a.cc:12:19: error: expected primary-expression before '==' token
12 | for(int j==0;j<4;j++){
| ^~
a.cc:12:26: error: expected ')' before ';' token
12 | for(int j==0;j<4;j++){
| ~ ^
| )
a.cc:12:27: error: 'j' was not declared in this scope
12 | for(int j==0;j<4;j++){
| ^
|
s450411094 | p00433 | C++ | //include
//------------------------------------------
#include <bits/stdc++.h> // only for GCC
using namespace std;
//typedef
//------------------------------------------
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;
//container util
//------------------------------------------
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
//repetition
//------------------------------------------
#define loop(i,a,b) for(ull i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define riter(i,c) for(auto i=(c).rbegin(); i!=(c).rend(); ++i)
//constant
//--------------------------------------------
const double eps = 1e-10;
const double pi = acos(-1.0);
const double inf = (int)1e8;
// output vector
// ------------------------------------------
namespace std {
template<typename T>ostream&operator<<(ostream&os, vector<T>const&v){
iter(it,v) os<<*it<<(it+1==v.end()?"":",");
return os;
}
template<typename T, typename U>ostream&operator<<(ostream&os,const pair<T,U>&p){
return os << "[" << p.dirst << "," << p.second << "]";
}
}
//clear memory
// ------------------------------------------
#define clr(a,i) memset((a), (i) ,sizeof(a))
int main(){
vi a(4),b(4);
rep(i,4)cin>>a[i];
rep(i,4)cin>>b[i];
if(accumulate(all(a),0)>accumulate(all(b),0)) cout << accumulate(all(a),0) endl;
else cout << accumulate(all(a),0) endl;
} | a.cc: In function 'int main()':
a.cc:58:78: error: expected ';' before 'endl'
58 | if(accumulate(all(a),0)>accumulate(all(b),0)) cout << accumulate(all(a),0) endl;
| ^~~~~
| ;
a.cc:59:37: error: expected ';' before 'endl'
59 | else cout << accumulate(all(a),0) endl;
| ^~~~~
| ;
|
s172433338 | p00434 | Java | import java.util.*;
public class dareda {
Scanner sc = new Scanner(System.in);
int[] a = new int[30];
int i,n,a1,a2 = 0;
public void hantei() {
Arrays.fill(a,0);
for(i = 0;i <= 29;i++) {
n = sc.nextInt();
a[n-1] = 1;
}
for(i = 0;i <= 29;i++) {
if(a[i] != 1) {
System.out.println(i +1);
}
}
}
public static void main(String[] args) {
dareda ou = new dareda();
ou.hantei();
}
// TODO 自動生成されたメソッド・スタブ
} | Main.java:2: error: class dareda is public, should be declared in a file named dareda.java
public class dareda {
^
1 error
|
s361478371 | p00434 | Java | import java.util.*;
public class main {
Scanner sc = new Scanner(System.in);
int[] a = new int[30];
int i,n,a1,a2 = 0;
public void hantei() {
Arrays.fill(a,0);
for(i = 0;i <= 29;i++) {
n = sc.nextInt();
a[n-1] = 1;
}
for(i = 0;i <= 29;i++) {
if(a[i] != 1) {
System.out.println(i +1);
}
}
}
public static void main(String[] args) {
main ou = new main();
ou.hantei();
}
// TODO 自動生成されたメソッド・スタブ
} | Main.java:2: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s904758657 | p00434 | Java | import java.util.*;
public class dareda {
Scanner sc = new Scanner(System.in);
int[] a = new int[30];
int i,n = 0;
public void hantei() {
Arrays.fill(a,0);
for(i = 0;i <= 29;i++) {
n = sc.nextInt();
a[n-1] = 1;
}
for(i = 0;i <= 29;i++) {
if(a[i] != 1) {
System.out.println(i +1);
}
}
}
public static void main(String[] args) {
dareda ou = new dareda();
ou.hantei();
}
// TODO 自動生成されたメソッド・スタブ
} | Main.java:2: error: class dareda is public, should be declared in a file named dareda.java
public class dareda {
^
1 error
|
s734426062 | p00434 | Java | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
int num[31]={},cn=0;
for(int i=1; i<29; i++){
int n = stdIn.nextInt();
num[n]++;
}
for(int i=1; i<31; i++){
if(num[i]==0){
System.out.println(i);
cn++;
}
for(cn==2)break;
}
}
} | Main.java:7: error: ']' expected
int num[31]={},cn=0;
^
Main.java:7: error: illegal start of expression
int num[31]={},cn=0;
^
Main.java:17: error: not a statement
for(cn==2)break;
^
Main.java:17: error: ';' expected
for(cn==2)break;
^
4 errors
|
s749288379 | p00434 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
class Main
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
final int NUM = 28;
final int NUMs = 30;
ArrayList<Integer> al = new ArrayList<Integer>();
HashSet<Integer> h = new HashSet<Integer>();
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
for(int i = 0; i < NUM ;i++){
h.add(Integer.parseInt(in.readLine()));
}
for(int i= 0;i < NUMs ;i++){
if(!h.contains(i+1)){
System.out.println(i+1);
}
}
}
} | Main.java:8: error: '{' expected
class Main
^
Main.java:10: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) throws IOException {
^
(use --enable-preview to enable unnamed classes)
Main.java:27: error: class, interface, enum, or record expected
}
^
3 errors
|
s620373238 | p00434 | Java | import java.util.Scanner;
class Main
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
boolean submited[] = new boolean[30];
for (int i = 0; i < 28; i++)
{
submited[sc.nextInt() - 1] = true;
}
for (int i = 0; i < 30; i++)
{
if (!submited)System.out.println(i+1);
}
}
} | Main.java:15: error: bad operand type boolean[] for unary operator '!'
if (!submited)System.out.println(i+1);
^
1 error
|
s227694262 | p00434 | Java | import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
int[] attendanceNumbers = new int[28];
for(int i:attendanceNumbers)attendanceNumbers[i] = stdIn.nextInt();
Arrays.sort(attendanceNumbers);
for(int j=0;j<28;j++){
if(attendanceNumbers[j]!=(j+1)){
System.out.println(attendanceNumbers[j]);
j++;
}
}
}
} | Main.java:8: error: cannot find symbol
Arrays.sort(attendanceNumbers);
^
symbol: variable Arrays
location: class Main
1 error
|
s665084568 | p00434 | Java | import java.util.Scanner;
import java.util.Arrays;
class Main{
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
int[] attendanceNumbers = new int[28];
for(int i:attendanceNumbers)attendanceNumbers[i] = stdIn.nextInt();
Arrays.sort(attendanceNumbers);
ArrayList<Integer> array = new ArrayList<Integer>();
for(int j=1;j<=30;j++)array.add(j);
for(int k:attendanceNumbers)array.remove(k);
for(int l:attendanceNumbers)System.out.println(l)
}
} | Main.java:13: error: ';' expected
for(int l:attendanceNumbers)System.out.println(l)
^
1 error
|
s847024498 | p00434 | Java | import java.util.Scanner;
import java.util.Arrays;
class Main{
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
int[] attendanceNumbers = new int[28];
for(int i:attendanceNumbers)attendanceNumbers[i] = stdIn.nextInt();
Arrays.sort(attendanceNumbers);
ArrayList<Integer> array = new ArrayList<Integer>();
for(int j=1;j<=30;j++)array.add(j);
for(int k:attendanceNumbers)array.remove(k);
for(int l:attendanceNumbers)System.out.println(l);
}
} | Main.java:10: error: cannot find symbol
ArrayList<Integer> array = new ArrayList<Integer>();
^
symbol: class ArrayList
location: class Main
Main.java:10: error: cannot find symbol
ArrayList<Integer> array = new ArrayList<Integer>();
^
symbol: class ArrayList
location: class Main
2 errors
|
s916098899 | p00434 | Java | import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;
class Main{
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
while(true){
int[] attendanceNumbers = new int[28];
for(int i=0;i<28;i++)attendanceNumbers[i] = stdIn.nextInt();
Arrays.sort(attendanceNumbers);
ArrayList<Integer> array = new ArrayList<Integer>();
for(i=1;i<=30;i++)array.add(i);
for(i:attendanceNumbers)array.remove(i);
for(i:attendanceNumbers)System.out.println(i);
}
}
} | Main.java:14: error: bad initializer for for-loop
for(i:attendanceNumbers)array.remove(i);
^
Main.java:15: error: bad initializer for for-loop
for(i:attendanceNumbers)System.out.println(i);
^
2 errors
|
s472429221 | p00434 | Java | import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;
class Main{
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
while(true){
int[] attendanceNumbers = new int[28];
int i;
for(i=0;i<28;i++)attendanceNumbers[i] = stdIn.nextInt();
Arrays.sort(attendanceNumbers);
ArrayList<Integer> array = new ArrayList<Integer>();
for(i=1;i<=30;i++)array.add(i);
for(i:attendanceNumbers)array.remove(i);
for(i:attendanceNumbers)System.out.println(i);
}
}
} | Main.java:15: error: bad initializer for for-loop
for(i:attendanceNumbers)array.remove(i);
^
Main.java:16: error: bad initializer for for-loop
for(i:attendanceNumbers)System.out.println(i);
^
2 errors
|
s933322325 | p00434 | C | #include <stdio.h>
int main(){
int data[30];
int i;
int in;
for(i=0;i<30;i++){
data[i]=0;
}
for(i=0;i<28);i++){
scanf("%d",&in);
data[in-1]=1;
}
for(i=0;i<30;i++){
if(data[i]==0){
printf("%d\n",i+1);
}
}
return 0;
} | main.c: In function 'main':
main.c:9:21: error: expected ';' before ')' token
9 | for(i=0;i<28);i++){
| ^
| ;
main.c:9:26: error: expected ';' before ')' token
9 | for(i=0;i<28);i++){
| ^
| ;
main.c:9:26: error: expected statement before ')' token
|
s657247616 | p00434 | C | #include <cstdio>
#include <set>
using namespace std;
int main()
{
set<int> se;
for(int i = 1; i <= 30; i++) se.insert(i);
for(int i = 0, t; i < 28; i++)
scanf("%d\n", &t), se.erase(t);
for(set<int>::iterator it = se.begin(); it != se.end(); it++)
printf("%d\n", *it);
return 0;
} | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s488564356 | p00434 | C | #include <iostream>
using namespace std;
int main(void)
{
int i, num;
bool student[30];
for( i=0; i<30; i++ )
student[i] = false;
for( i=0; i<28; i++ ){
cin >> num;
student[num-1] = true;
}
for( i=0; i<30; i++ )
if( !student[i] )
cout << i+1 << endl;
return 0;
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s483286948 | p00434 | C | #include <stdio.h>
int main(){
int a[30],b,c=0,d
for(i=0;i<28;i++){
scanf("%d",a[i]);
for(j=0;j<30;j++){
if(a[i]==j){
b[i]=1;
break;
}else{
b[i]=0;
}
}
}
for(i=0;i<28;i++){
if(b[i]==0&&c==0){
c=a[i];
}else if(b[i]==0&&c!=0){
d=a[i];
}
}
if(c<d){
printf("%d\n%d\n",c,d);
}else{
printf("%d\n%d\n",d,c);
}
return 0;
} | main.c: In function 'main':
main.c:5:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'for'
5 | for(i=0;i<28;i++){
| ^~~
main.c:5:17: error: 'i' undeclared (first use in this function)
5 | for(i=0;i<28;i++){
| ^
main.c:5:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:25: error: expected ';' before ')' token
5 | for(i=0;i<28;i++){
| ^
| ;
main.c:5:25: error: expected statement before ')' token
main.c:7:21: error: 'j' undeclared (first use in this function)
7 | for(j=0;j<30;j++){
| ^
main.c:20:25: error: 'd' undeclared (first use in this function)
20 | d=a[i];
| ^
|
s576249106 | p00434 | C | #include <stdio.h>
int main(){
int a[30],b,c=0,d,i,j;
for(i=0;i<28;i++){
scanf("%d",a[i]);
for(j=0;j<30;j++){
if(a[i]==j){
b[i]=1;
break;
}else{
b[i]=0;
}
}
}
for(i=0;i<28;i++){
if(b[i]==0&&c==0){
c=a[i];
}else if(b[i]==0&&c!=0){
d=a[i];
}
}
if(c<d){
printf("%d\n%d\n",c,d);
}else{
printf("%d\n%d\n",d,c);
}
return 0;
} | main.c: In function 'main':
main.c:9:34: error: subscripted value is neither array nor pointer nor vector
9 | b[i]=1;
| ^
main.c:12:34: error: subscripted value is neither array nor pointer nor vector
12 | b[i]=0;
| ^
main.c:17:21: error: subscripted value is neither array nor pointer nor vector
17 | if(b[i]==0&&c==0){
| ^
main.c:19:27: error: subscripted value is neither array nor pointer nor vector
19 | }else if(b[i]==0&&c!=0){
| ^
|
s790261836 | p00434 | C | #include <stdio.h>
int main(){
int a[30],b,i,
for(i=0;i<28;i++){
scanf("%d",&a[i]);
}
a[28]=10000000;
for(i=0;i<100000;i++){
if(a[i]>=a[i+1]){
b=a[i];
a[i]=a[i+1];
a[i+1]=b;
}
}
for(i=0;i<27;i++){
if(a[i]+3==a[i+1]){
c=a[i]+1;
d=a[i]+2;
printf("%d\n%d\n",c,d);
return 0;
}
if(a[i]+2==a[i+1]){
if(c==0){
c=a[i]+1;
}else{
d=a[i]+1;
}
}
}
printf("%d\n%d\n",c,d);
return 0;
} | main.c: In function 'main':
main.c:5:9: error: expected identifier or '(' before 'for'
5 | for(i=0;i<28;i++){
| ^~~
main.c:5:25: error: expected ';' before ')' token
5 | for(i=0;i<28;i++){
| ^
| ;
main.c:5:25: error: expected statement before ')' token
main.c:18:25: error: 'c' undeclared (first use in this function)
18 | c=a[i]+1;
| ^
main.c:18:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:25: error: 'd' undeclared (first use in this function)
19 | d=a[i]+2;
| ^
|
s193210080 | p00434 | C | #include<stdio.h>
int a[31];
int main(void){
int i,b;
for(i=0;i<28;i++){
scanf("%d",&b);
a[b]=1;
}
for(i=1;i<31;i++){
if(a[i]==0){
printf("%d\n",i);
}
return 0;
} | main.c: In function 'main':
main.c:14:1: error: expected declaration or statement at end of input
14 | }
| ^
|
s951437057 | p00434 | C | #include<stdio.h>
int main(){
int number[28],i,j,a=0,b=0,flag;
int (i=0;i<28;i++){
scanf("%d?\n",&number[i]);
}
for(i=0;i<30;i++){
for(j=0;j<28;j++){
if(i==number[j]) flag=1;
}
if(flag==0 && a>0)b=i+1;
if(flag==0 && a==0)a=i+1;
flag=0;
if(b>0)break;
}
printf("%d?\n%d?\n",a,b);
return 0;
} | main.c: In function 'main':
main.c:4:7: error: expected ')' before '=' token
4 | int (i=0;i<28;i++){
| ^
| )
|
s272689340 | p00434 | C | #include<stdio.h>
int main(){
int number[28],i,j,a=0,b=0,flag;
int (i=0;i<28;i++){
scanf("%d?\n",&number[i]);
}
for(i=0;i<30;i++){
for(j=0;j<28;j++){
if(i==number[j]) flag=1;
}
if(flag==0 && a>0)b=i+1;
if(flag==0 && a==0)a=i+1;
flag=0;
if(b>0)break;
}
printf("%d?\n%d?\n",a,b);
return 0;
} | main.c: In function 'main':
main.c:4:7: error: expected ')' before '=' token
4 | int (i=0;i<28;i++){
| ^
| )
|
s682742974 | p00434 | C | #include<stdio.h>
int main(){
int number[28],i,j,a=0,b=0,flag;
for (i=0;i<28;i++){
scanf("%d?\n",&number[i]);
}
for(i=1;i<=30;i++){
for(j=0;j<28;j++){
if(inumber[j]==i) flag=1;
}
if(flag==0){
if(a==0)a=i;else b=i;
}else{
flag=0;
}
//if(b>0)break;
}
printf("%d?\n%d?\n",a,b);
return 0;
} | main.c: In function 'main':
main.c:9:4: error: 'inumber' undeclared (first use in this function); did you mean 'number'?
9 | if(inumber[j]==i) flag=1;
| ^~~~~~~
| number
main.c:9:4: note: each undeclared identifier is reported only once for each function it appears in
|
s677215773 | p00434 | C | #include<stdio.h>
int main(){
int number[28],i,j,a=0,b=0,flag;
for (i=0;i<28;i++){
scanf("%d?\n",&n[i]);
}
for(i=1;i<=30;i++){
for(j=0;j<28;j++){
if(n[j]==i) flag=1;
}
if(flag==0){
if(a==0)a=i;else b=i;
}else{
flag=0;
}
//if(b>0)break;
}
printf("%d?\n%d?\n",a,b);
return 0;
} | main.c: In function 'main':
main.c:5:16: error: 'n' undeclared (first use in this function)
5 | scanf("%d?\n",&n[i]);
| ^
main.c:5:16: note: each undeclared identifier is reported only once for each function it appears in
|
s386622727 | p00434 | C | #include<stdio.h>
int main(){
int a[30],i,z;
for(i=1,i<=30,i++){
a[i]=1;
}
for(i=1,i<=28,i++){
scanf("%d",&z);
a[z]=0;
}
for(i=1,i<=30,i++){
if( a[i]==1 ){
printf("%d\n",i); }
}
retrun 0;
} | main.c: In function 'main':
main.c:7:18: error: expected ';' before ')' token
7 | for(i=1,i<=30,i++){
| ^
| ;
main.c:7:18: error: expected expression before ')' token
main.c:11:18: error: expected ';' before ')' token
11 | for(i=1,i<=28,i++){
| ^
| ;
main.c:11:18: error: expected expression before ')' token
main.c:16:18: error: expected ';' before ')' token
16 | for(i=1,i<=30,i++){
| ^
| ;
main.c:16:18: error: expected expression before ')' token
main.c:21:1: error: 'retrun' undeclared (first use in this function)
21 | retrun 0;
| ^~~~~~
main.c:21:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:7: error: expected ';' before numeric constant
21 | retrun 0;
| ^~
| ;
|
s318790766 | p00434 | C | #include<stdio.h>
int main(){
int a[30],i,z;
for(i=1;i<=30;i++){
a[i]=1;
}
for(i=1;i<=28;i++){
scanf("%d",&z);
a[z]=0;
}
for(i=1;i<=30;i++){
if( a[i]==1 ){
printf("%d\n",i); }
}
retrun 0;
} | main.c: In function 'main':
main.c:21:1: error: 'retrun' undeclared (first use in this function)
21 | retrun 0;
| ^~~~~~
main.c:21:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:7: error: expected ';' before numeric constant
21 | retrun 0;
| ^~
| ;
|
s481904727 | p00434 | C | #include<stdio.h>
int main() {
int N[31]={0};
int i;
int j=0;
for (i = 0; i < 29; i++) {
scanf_s("%d", &j);
N[j] = 1;
}
for (i = 0; i < 31; i++) {
if (N[i] == 0)
printf_s("%d\n", i);
}
return 0;
} | main.c: In function 'main':
main.c:8:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
8 | scanf_s("%d", &j);
| ^~~~~~~
| scanf
main.c:13:25: error: implicit declaration of function 'printf_s'; did you mean 'printf'? [-Wimplicit-function-declaration]
13 | printf_s("%d\n", i);
| ^~~~~~~~
| printf
|
s390085326 | p00434 | C | #include<stdio.h>
int main() {
int N[31]={0};
int i;
int j=0;
for (i = 0; i < 29; i++) {
scanf_s("%d", &j);
N[j] = 1;
}
for (i = 1; i < 31; i++) {
if (N[i] == 0)
printf("%d\n", i);
}
return 0;
} | main.c: In function 'main':
main.c:8:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
8 | scanf_s("%d", &j);
| ^~~~~~~
| scanf
|
s767203179 | p00434 | C | #include <stdio.h>
#include <stdlib.h>
#define N 256
int who[2];
int compar(const void *val1,const void *val2){
if(*val1<*val2){
return -1;
}
else if(*val1== *val2){
return 0;
}
else{
return 1;
}
}
void detect(const int *pnt) {
int i = 1, j = 0;
int count = 0;
while (1) {
if (i != pnt[j]) {
who[count] = i;
count++;
i++;
if (count == 2) {
break;
}
}
else {
i++;
j++;
}
}
}
int main(void) {
int stdntID[5];
int i,j;
for (i = 0; i<5; i++) {
scanf("%d", &stdntID[i]);
}
qsort(stdntID,5,sizeof(int),compar);
detect(stdntID);
printf("%d\n", who[0]);
printf("%d\n", who[1]);
return 0;
}
| main.c: In function 'compar':
main.c:9:12: warning: dereferencing 'void *' pointer
9 | if(*val1<*val2){
| ^~~~~
main.c:9:18: warning: dereferencing 'void *' pointer
9 | if(*val1<*val2){
| ^~~~~
main.c:9:12: error: void value not ignored as it ought to be
9 | if(*val1<*val2){
| ^~~~~
main.c:9:18: error: void value not ignored as it ought to be
9 | if(*val1<*val2){
| ^~~~~
main.c:12:17: warning: dereferencing 'void *' pointer
12 | else if(*val1== *val2){
| ^~~~~
main.c:12:25: warning: dereferencing 'void *' pointer
12 | else if(*val1== *val2){
| ^~~~~
main.c:12:17: error: void value not ignored as it ought to be
12 | else if(*val1== *val2){
| ^~~~~
main.c:12:25: error: void value not ignored as it ought to be
12 | else if(*val1== *val2){
| ^~~~~
|
s071950508 | p00434 | C | #include <stdio.h>int main(){int a=0,n=28,m;while(n--){scanf("%d",&m);a+=(1<<(m-1));}for(n=1;n<31;n++,a>>=1)if(~a&1)printf("%d\n",n);} | main.c:1:19: warning: extra tokens at end of #include directive
1 | #include <stdio.h>int main(){int a=0,n=28,m;while(n--){scanf("%d",&m);a+=(1<<(m-1));}for(n=1;n<31;n++,a>>=1)if(~a&1)printf("%d\n",n);}
| ^~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s431385885 | p00434 | C | #include<iostream>
using namespace std;
int main(){
bool a[31];
while(1){
for(int i = 0 ; i < 30 ; i++ ) a[i] = false;
int d;
for(int i = 0 ; i < 28 ; i++ ){
cin>>d;
a[d] = true;
}
for(int i = 1 ; i <= 30 ; i++ ){
if(a[i]==false)cout<<i<<endl;
}
}
} | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s318614886 | p00434 | C | t i = 1 ; i <= 30 ; i++ ){
if(a[i]==false)cout<<i<<endl;
}
}
} | main.c:1:1: error: unknown type name 't'
1 | t i = 1 ; i <= 30 ; i++ ){
| ^
main.c:1:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
1 | t i = 1 ; i <= 30 ; i++ ){
| ^~
main.c:1:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
1 | t i = 1 ; i <= 30 ; i++ ){
| ^~
main.c:4:3: error: expected identifier or '(' before '}' token
4 | }
| ^
main.c:5:1: error: expected identifier or '(' before '}' token
5 | }
| ^
|
s656623738 | p00434 | C |
#include<iostream>
using namespace std;
int main(){
bool a[31];
int d;
while(cin>>d){
for(int i = 0 ; i < 30 ; i++ ) a[i] = false;
for(int i = 0 ; i < 28 ; i++ ){
a[d] = true;
if(i!=27)cin>>d;
}
for(int i = 1 ; i <= 30 ; i++ ){
if(a[i]==false)cout<<i<<endl;
}
}
} | main.c:2:9: fatal error: iostream: No such file or directory
2 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s599985743 | p00434 | C | #include<iostream>
using namespace std;
int main(){
bool a[31];
int d;
while(cin>>d){
for(int i = 0 ; i < 30 ; i++ ) a[i] = false;
for(int i = 0 ; i < 28 ; i++ ){
a[d] = true;
if(i!=27)cin>>d;
}
for(int i = 1 ; i <= 30 ; i++ ){
if(a[i]==false)cout<<i<<endl;
}
}
} | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s003035413 | p00434 | C | #include<iostream>
using namespace std;
int main(){
int a[31];
int d;
while(cin>>d){
for(int i = 0 ; i <= 30 ; i++ ) a[i] = 0;
for(int i = 0 ; i < 28 ; i++ ){
a[d] = 1;
if(i!=27)cin>>d;
}
for(int i = 1 ; i <= 30 ; i++ ){
if(a[i]==0)cout<<i<<endl;
}
//for(int i = 1 ; i <= 30 ; i++) cout<<a[d]<<endl;
}
} | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s689053070 | p00434 | C | ////////////////////////////
//情報オリンピック過去問////
//Score ////
//AOJ 0511 ////
////////////////////////////
int <stdio.h>
int main(){
int a[28];
int b;
int d;
d=465
do{
scanf("%d",&a[b]);
b++;
d=465-a[b]
}while(b<=28)
int yet1,yet2;
for(int C=1;C<31;C++){
for(int d=1;d<29;d++){
if (C>a[d]||C<a[d]){
yet1=C;
}
]
}
yet2=d-yet1;
int max,min
if(yet1>yet2){max=yet1;min=yet2}
else{max=yet2;min=yet1}
printf("%d\n%d\n",max,min);
return0;
}
//end
| main.c:7:5: error: expected identifier or '(' before '<' token
7 | int <stdio.h>
| ^
|
s535545121 | p00434 | C |
#include<stdio.h>
main(){
int i,s[50],n[50];
for(i=1;i<=28;i++){
s[i]=1;#include<stdio.h>
main(){
int i,s[50],n[50];
for(i=1;i<=28;i++){
s[i]=1;
}
for(i=1;i<=28;i++){
scanf("%d",&n[i]);
s[n[i]]=0;
}
for(i=1;i<=28;i++){
if(s[i]==1){
printf("%d\n",i);
}
}
return 0;
}
}
for(i=1;i<=28;i++){
scanf("%d",&n[i]);
s[n[i]]=0;
}
for(i=1;i<=28;i++){
if(s[i]==1){
printf("%d\n",i);
}
}
return 0;
} | main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
3 | main(){
| ^~~~
main.c: In function 'main':
main.c:6:12: error: stray '#' in program
6 | s[i]=1;#include<stdio.h>
| ^
main.c:6:13: error: 'include' undeclared (first use in this function)
6 | s[i]=1;#include<stdio.h>
| ^~~~~~~
main.c:6:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:21: error: 'stdio' undeclared (first use in this function); did you mean 'stdin'?
6 | s[i]=1;#include<stdio.h>
| ^~~~~
| stdin
main.c:7:7: error: expected ';' before '{' token
7 | main(){
| ^
| ;
|
s540812400 | p00434 | C | include <stdio.h>
int main(){
int flag[31] = {0}, i, input;
for(i = 1; i < 29;i++){
scanf("%d", &input);
flag[input] = 1;
}
for(i = 1; i < 31;i++){
if(flag[i] != 1){
printf("%d\n", i);
}
}
return 0;
} | main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
|
s871526421 | p00434 | C++ | #include <iostream>
using namespace std;
int main () {
int i, n, N[30] = {};
for(i=0;i<28;i++) {
cin << n;
N[n]=1;
}
for(i=0;i<30;i++) {
if(N[n]==0) {
cout << N[n] << endl;
}
}
} | a.cc: In function 'int main()':
a.cc:7:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
7 | cin << n;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:7:13: note: candidate: 'operator<<(int, int)' (built-in)
7 | cin << n;
| ~~~~^~~~
a.cc:7:13: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << n;
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:7:9: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
7 | cin << n;
| ^~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << n;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:7:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << n;
| ^
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]':
a.cc:7:16: required from here
7 | cin << n;
| ^
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
|
s130841603 | p00434 | C++ | #include<iostream>
using namespace std;
int main(void)
{
int student[32],n;
for(int i=1;i<31;i++){
student[i]=0;
}
for(int i=0;i<28;i++){
cin>>n;
student[n]=1;
}
for(int i=1;i<31;i++){
if(student[i]==0)cout<<i<<"\n";
}
}
| a.cc:17:1: error: extended character is not valid in an identifier
17 |
| ^
a.cc:17:1: error: '\U00003000' does not name a type
17 |
| ^~
|
s582387982 | p00434 | C++ | #include <iostream>
using namespace std;
int main(){
int tmp, num[35] = { -1 };
for (int i = 0; i < 28;i++){
cin >> tmp;
num[tmp] = 1;
}
for (i = 0; i < 28; i++){
if (num[i] == -1)
cout << num[i] << endl;
}
} | a.cc: In function 'int main()':
a.cc:9:14: error: 'i' was not declared in this scope
9 | for (i = 0; i < 28; i++){
| ^
|
s524906846 | p00434 | C++ | #include <iostream>
#include <cstring>
using namespace std;
int main(){
int tmp, num[35];
memset(num, -1, sizeof(num));
for (int i = 0; i < 28;i++){
cin >> tmp;
num[tmp] = 1;
}
for (int i = 1; i < 31; i++){
if (num[i] == -1)
cout << num[i] << endl;
} | a.cc: In function 'int main()':
a.cc:14:10: error: expected '}' at end of input
14 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s244551218 | p00434 | C++ | #include <iostram>
using namespace std;
int main(){
bool id[31];
for(int i = 0; i < 28; i++){
int tmp;
cin >> tmp;
id[tmp] = true;
}
for(int i = 1; i <= 30; i++){
if(!id[i]) cout << i << endl;
}
return 0;
} | a.cc:1:10: fatal error: iostram: No such file or directory
1 | #include <iostram>
| ^~~~~~~~~
compilation terminated.
|
s825994905 | p00434 | C++ | #inculude<iostream>
using namespace std;
int main(){
bool student[30];
int n;
for(int i = 0; i< 30; i++){
student[i] = 0;
}
for(int i = 0; i< 30; i++){
cin >> n;
student[n] = 1;
}
for(int i = 0; i< 30; i;+){
if(student[i] == 0) cout << i << endl;
}
return 0;
} | a.cc:1:2: error: invalid preprocessing directive #inculude; did you mean #include?
1 | #inculude<iostream>
| ^~~~~~~~
| include
a.cc: In function 'int main()':
a.cc:14:5: error: 'cin' was not declared in this scope
14 | cin >> n;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | #inculude<iostream>
a.cc:18:26: error: expected ')' before ';' token
18 | for(int i = 0; i< 30; i;+){
| ~ ^
| )
a.cc:18:28: error: expected primary-expression before ')' token
18 | for(int i = 0; i< 30; i;+){
| ^
|
s120171635 | p00434 | C++ | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n").map(Number);
for(i=1;i<=30;i++){
if(Arr.indexOf(i)==-1)console.log(i);
} | a.cc:1:21: warning: multi-character character constant [-Wmultichar]
1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
| ^~~~
a.cc:1:40: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
| ^~~~~~~~~~~~
a.cc:1:54: warning: multi-character character constant [-Wmultichar]
1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
| ^~~~~~
a.cc:1:1: error: 'var' does not name a type
1 | var input = require('fs').readFileSync('/dev/stdin', 'utf8');
| ^~~
a.cc:2:1: error: 'var' does not name a type
2 | var Arr=(input.trim()).split("\n").map(Number);
| ^~~
a.cc:3:1: error: expected unqualified-id before 'for'
3 | for(i=1;i<=30;i++){
| ^~~
a.cc:3:9: error: 'i' does not name a type
3 | for(i=1;i<=30;i++){
| ^
a.cc:3:15: error: 'i' does not name a type
3 | for(i=1;i<=30;i++){
| ^
|
s908676705 | p00434 | C++ | #include<stdio.h>
int main(){
bool N[31]={};int x;
for(int i=0;i<30;i++)
bool[i]=false;
for(int i=0;i<30;i++)
{scan("%d",&x);N[x]=true;}
for(int i=0;i<30;i++)
{if(N[i]==false)printf("%d\n",(i+1));}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:5: error: structured binding declaration cannot have type 'bool'
7 | bool[i]=false;
| ^~~
a.cc:7:5: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:7:6: error: redeclaration of 'auto i'
7 | bool[i]=false;
| ^
a.cc:6:9: note: 'int i' previously declared here
6 | for(int i=0;i<30;i++)
| ^
a.cc:7:5: error: cannot decompose non-array non-class type 'bool'
7 | bool[i]=false;
| ^~~
a.cc:9:2: error: 'scan' was not declared in this scope; did you mean 'scanf'?
9 | {scan("%d",&x);N[x]=true;}
| ^~~~
| scanf
|
s649941293 | p00434 | C++ | #include<stdio.h>
int main(){
bool N[31]={};int x;
for(int i=0;i<30;i++)
bool[i]=false;
for(int i=0;i<30;i++)
{scan("%d",&x);N[x]=true;}
for(int i=0;i<30;i++)
{if(N[i]==false)printf("%d\n",(i+1));}
return 0;
}
#include<stdio.h>
int main(){
bool N[31]={};int x;
for(int i=0;i<30;i++)
N[i]=false;
for(int i=0;i<30;i++)
{scanf("%d",&x);N[x]=true;}
for(int i=0;i<30;i++)
{if(N[i]==false)printf("%d\n",(i+1));}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:5: error: structured binding declaration cannot have type 'bool'
7 | bool[i]=false;
| ^~~
a.cc:7:5: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:7:6: error: redeclaration of 'auto i'
7 | bool[i]=false;
| ^
a.cc:6:9: note: 'int i' previously declared here
6 | for(int i=0;i<30;i++)
| ^
a.cc:7:5: error: cannot decompose non-array non-class type 'bool'
7 | bool[i]=false;
| ^~~
a.cc:9:2: error: 'scan' was not declared in this scope; did you mean 'scanf'?
9 | {scan("%d",&x);N[x]=true;}
| ^~~~
| scanf
a.cc: At global scope:
a.cc:17:5: error: redefinition of 'int main()'
17 | int main(){
| ^~~~
a.cc:3:5: note: 'int main()' previously defined here
3 | int main(){
| ^~~~
|
s368013444 | p00434 | C++ | #include <stdio.h>
int main(){
int a[28],i,j,x[30];
for (i=0;i<28;i++) {
scanf("%d",&a[i]);
}
for (i=0;i<30;i++) {
x[i]=0;
for (j=0;j<28;j++) {
if (a[j]==i) {x[i]=1;}
}
}
for (i=0;i<30;i++) {
if (x[i]==0) {
printf("%d\n",i)
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:16:29: error: expected ';' before '}' token
16 | printf("%d\n",i)
| ^
| ;
17 | }
| ~
|
s716138328 | p00434 | C++ | include<iostream>
using namespace std;
int main(){
int a[30];
for(int i = 0;i <= 29;i++){
a[i] = 0;
}
for(int ii = 1;ii <= 28;ii++){
int n;
cin >> n;
a[n - 1] = 1;
}
for(int p = 0;p <= 29;p++){
if(a[p] == 0){
cout << p + 1 << endl;
}
}
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:11:1: error: 'cin' was not declared in this scope
11 | cin >> n;
| ^~~
a.cc:16:1: error: 'cout' was not declared in this scope
16 | cout << p + 1 << endl;
| ^~~~
a.cc:16:18: error: 'endl' was not declared in this scope
16 | cout << p + 1 << endl;
| ^~~~
|
s004301499 | p00434 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int n1 = 30;
int a[n1];
for (int i = 0; i < 30; i++){
cin >> a[i];
}
sort(a, a + n1);
for (int i = 0; i < 30; i++){
if (a[i + 1] - a[i] = 2)
cout<<a[i]+1<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:30: error: lvalue required as left operand of assignment
12 | if (a[i + 1] - a[i] = 2)
| ~~~~~~~~~^~~~~~
|
s941669769 | p00434 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
for (int n = 0; n < 2; n++)
int a[30] = { 0 };
for (int i = 0; i < 30; i++){
cin >> a[i];
}
sort(a, a + 30);
for (int i = 0; i < 30; i++){
if (a[i + 1] - a[i]==2)
cout<<a[i]+1<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:24: error: 'a' was not declared in this scope
8 | cin >> a[i];
| ^
a.cc:10:14: error: 'a' was not declared in this scope
10 | sort(a, a + 30);
| ^
|
s187010113 | p00434 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
if (int n = 0; n < 5;n++);
int a[30] = { 0 };
for (int i = 0; i < 30; i++){
cin >> a[i];
}
sort(a, a + 30);
for (int i1 = 0; i1 < 30; i1++){
if (i1 != 1){
if (a[i1 + 1] - a[i1] == 2){
cout << a[i1] + 1 << endl;
}
if (a[i1 + 1] - a[i1] == 3){
cout << a[i1] + 1 << endl << a[i1] + 2 << endl;
break;
}
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:29: error: expected ')' before ';' token
6 | if (int n = 0; n < 5;n++);
| ~ ^
| )
a.cc:6:30: error: 'n' was not declared in this scope
6 | if (int n = 0; n < 5;n++);
| ^
|
s731376080 | p00434 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
for (int n = 0; n < 5; n++){
int a[30] = { 0 };
for (int i = 0; i < 30; i++){
cin >> a[i];
}
sort(a, a + 30);
for (int i1 = 0; i1 < 30; i1++){
if (a[i1+1]-a[i] != 1){
if (a[i1 + 1] - a[i1] == 2){
cout << a[i1] + 1 << endl;
}
if (a[i1 + 1] - a[i1] == 3){
cout << a[i1] + 1 << endl << a[i1] + 2 << endl;
break;
}
}
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:13:39: error: 'i' was not declared in this scope; did you mean 'i1'?
13 | if (a[i1+1]-a[i] != 1){
| ^
| i1
|
s185691533 | p00434 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
for (int n = 0; n < 5; n++){
int a[31] = { 0 };
for (int i = 0; i < 28; i++){
int n;
cin >> n;
}
int a[n]={1}
for (int i=1; i<31;i++){
if (a(i)=0){
cout<<i<<endl}
}
} | a.cc: In function 'int main()':
a.cc:12:24: error: conflicting declaration 'int a [n]'
12 | int a[n]={1}
| ^
a.cc:7:21: note: previous declaration as 'int a [31]'
7 | int a[31] = { 0 };
| ^
a.cc:13:31: error: 'i' was not declared in this scope
13 | for (int i=1; i<31;i++){
| ^
a.cc:17:2: error: expected '}' at end of input
17 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s953644157 | p00434 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
for (int n = 0; n < 5; n++){
int a[31] = { 0 };
for (int i = 0; i < 28; i++){
int n;
cin >> n;
int a[n] = { 1 };
}
for (int i = 1; i<31; i++){
if ( a(i) == 0 ){
cout << i << endl;
}
}
} | a.cc: In function 'int main()':
a.cc:15:31: error: 'a' cannot be used as a function
15 | if ( a(i) == 0 ){
| ~^~~
a.cc:19:10: error: expected '}' at end of input
19 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s127563349 | p00434 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int t[31] = { 0 };
int n;
for (int i = 0; i < 28; i++){
cin >> n;
int t[n] = { 1 };
}
for (int i = 1; i<31; i++){
if ( t(i) == 0 ){
cout << i << endl;
}
}
} | a.cc: In function 'int main()':
a.cc:15:32: error: 't' cannot be used as a function
15 | if ( t(i) == 0 ){
| ~^~~
|
s907871804 | p00434 | C++ | #include <cstdio>
using namespace std;
bool count[30];
int main(){
for(int i = 0; i < 30; i++){
count[i] = false;
}
for(int i = 0; i < 28; i++){
int a;
scanf("%d", &a);
count[a] = true;
}
for(int i = 0; i < 30; i++){
if(count[a]){
printf("%d\n", i);
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:17:14: error: 'a' was not declared in this scope
17 | if(count[a]){
| ^
|
s980148004 | p00434 | C++ | #include <iostream>
using namespace std;
int main() {
int yj[30] = ();
int unco[28] = ();
int a;
cin >> unco[28];
for(i = 0, i < 28 , i++){
yj[i] = i - 1;
a = unco[i];
yj[a - 1] = 0;
}
for(i = 0, i < 30 , i++){
if(yj[i] != 0)
cout << yj[i]<< endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:23: error: expected primary-expression before ')' token
5 | int yj[30] = ();
| ^
a.cc:6:25: error: expected primary-expression before ')' token
6 | int unco[28] = ();
| ^
a.cc:9:13: error: 'i' was not declared in this scope
9 | for(i = 0, i < 28 , i++){
| ^
a.cc:14:9: error: expected primary-expression before 'for'
14 | for(i = 0, i < 30 , i++){
| ^~~
a.cc:13:10: error: expected ';' before 'for'
13 | }
| ^
| ;
14 | for(i = 0, i < 30 , i++){
| ~~~
a.cc:14:9: error: expected primary-expression before 'for'
14 | for(i = 0, i < 30 , i++){
| ^~~
a.cc:13:10: error: expected ')' before 'for'
13 | }
| ^
| )
14 | for(i = 0, i < 30 , i++){
| ~~~
a.cc:9:12: note: to match this '('
9 | for(i = 0, i < 28 , i++){
| ^
a.cc:18:9: error: expected primary-expression before 'return'
18 | return 0;
| ^~~~~~
a.cc:17:10: error: expected ';' before 'return'
17 | }
| ^
| ;
18 | return 0;
| ~~~~~~
a.cc:18:9: error: expected primary-expression before 'return'
18 | return 0;
| ^~~~~~
a.cc:17:10: error: expected ')' before 'return'
17 | }
| ^
| )
18 | return 0;
| ~~~~~~
a.cc:14:12: note: to match this '('
14 | for(i = 0, i < 30 , i++){
| ^
|
s136428322 | p00434 | C++ | #include <iostream>
using namespace std;
int main() {
int yj[30] = {};
int unco[28] = {};
int a;
cin >> unco[28];
for(i = 0, i < 28 , i++){
yj[i] = i - 1;
a = unco[i];
yj[a - 1] = 0;
}
for(i = 0, i < 30 , i++){
if(yj[i] != 0)
cout << yj[i]<< endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:13: error: 'i' was not declared in this scope
9 | for(i = 0, i < 28 , i++){
| ^
a.cc:14:9: error: expected primary-expression before 'for'
14 | for(i = 0, i < 30 , i++){
| ^~~
a.cc:13:10: error: expected ';' before 'for'
13 | }
| ^
| ;
14 | for(i = 0, i < 30 , i++){
| ~~~
a.cc:14:9: error: expected primary-expression before 'for'
14 | for(i = 0, i < 30 , i++){
| ^~~
a.cc:13:10: error: expected ')' before 'for'
13 | }
| ^
| )
14 | for(i = 0, i < 30 , i++){
| ~~~
a.cc:9:12: note: to match this '('
9 | for(i = 0, i < 28 , i++){
| ^
a.cc:18:9: error: expected primary-expression before 'return'
18 | return 0;
| ^~~~~~
a.cc:17:10: error: expected ';' before 'return'
17 | }
| ^
| ;
18 | return 0;
| ~~~~~~
a.cc:18:9: error: expected primary-expression before 'return'
18 | return 0;
| ^~~~~~
a.cc:17:10: error: expected ')' before 'return'
17 | }
| ^
| )
18 | return 0;
| ~~~~~~
a.cc:14:12: note: to match this '('
14 | for(i = 0, i < 30 , i++){
| ^
|
s474841355 | p00434 | C++ | #include <iostream>
using namespace std;
int main() {
int yj[30] = {};
int unco[28] = {};
int a;
cin >> unco[28];
for(i = 0; i < 28 ; i++){
yj[i] = i - 1;
a = unco[i];
yj[a - 1] = 0;
}
for(i = 0; i < 30 ; i++){
if(yj[i] != 0)
cout << yj[i]<< endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:13: error: 'i' was not declared in this scope
9 | for(i = 0; i < 28 ; i++){
| ^
a.cc:14:13: error: 'i' was not declared in this scope
14 | for(i = 0; i < 30 ; i++){
| ^
|
s331500173 | p00434 | C++ | #include <iostream>
using namespace std;
int main() {
int student[31];
for(int i=0;i<31;i++){
student[i]=0;
}
for(int i=0;i<28;i++){
int number;
cin>>number;
student[number]=1;
}
for(int i=1;i<30;i++){
if(student[i]==0){
cout<<i<<endl;
}
}
return 0;
}
javascript:void(0) | a.cc:21:1: error: 'javascript' does not name a type
21 | javascript:void(0)
| ^~~~~~~~~~
|
s044837968 | p00434 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define pb push_back
using namespace std;
int main() {
//freopen("0511.inp", "r", stdin);
bool b[31]; memset(b, false, sizeof(b));
loop(i, 0, 28) {
int n; cin >> n;
b[n] = true;
}
loop(i, 1, 31) if (!b[i]) cout << i << endl;
} | a.cc: In function 'int main()':
a.cc:14:21: error: 'memset' was not declared in this scope
14 | bool b[31]; memset(b, false, sizeof(b));
| ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
6 | #include <cstdio>
+++ |+#include <cstring>
7 | #define loop(i,a,b) for(int i=a;i<b;i++)
|
s394839786 | p00434 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define pb push_back
using namespace std;
int main() {
//freopen("0511.inp", "r", stdin);
bool b[31]; memset(b, false, sizeof(b));
loop(i, 0, 28) {
int n; cin >> n;
b[n] = true;
}
loop(i, 1, 31) if (!b[i]) cout << i << endl;
} | a.cc: In function 'int main()':
a.cc:14:21: error: 'memset' was not declared in this scope
14 | bool b[31]; memset(b, false, sizeof(b));
| ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
6 | #include <cstdio>
+++ |+#include <cstring>
7 | #define loop(i,a,b) for(int i=a;i<b;i++)
|
s805131212 | p00434 | C++ | #include <iostream>
2 using namespace std;
3
4 int main(void)
5 {
6 bool a[30] = {false};
7 int n, i;
8
9 for(i = 0; i < 28; i++){
10 cin >> n;
11 a[n] = true;
12 }
13 for(i = 1; i <= 30; i++){
14 if(a[i] == false){
15 cout << i << endl;
16 }
17 }
18 return (0);
19 } | a.cc:2:3: error: expected unqualified-id before numeric constant
2 | 2 using namespace std;
| ^
a.cc:3:3: error: expected unqualified-id before numeric constant
3 | 3
| ^
|
s430737825 | p00434 | C++ | int main() {
int M[28],A[31],o=0;
for(int i=0;i<28;i++){
cin >> M[i];
}
for(int i=0;i<28;i++){
A[M[i]]=M[i];
}
for(int i=0;i<30;i++){
if(A[i+1]==i+1){
}
else{
o++;
}
}
cout << o << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:4:17: error: 'cin' was not declared in this scope
4 | cin >> M[i];
| ^~~
a.cc:17:9: error: 'cout' was not declared in this scope
17 | cout << o << endl;
| ^~~~
a.cc:17:22: error: 'endl' was not declared in this scope
17 | cout << o << endl;
| ^~~~
|
s822877192 | p00434 | C++ | using namespace std;
int main() {
int M[28],A[31],o=0;
for(int i=0;i<28;i++){
cin >> M[i];
}
for(int i=0;i<28;i++){
A[M[i]]=M[i];
}
for(int i=1;i<31;i++){
if(A[i]==i){
}
else{
cout << i << endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:17: error: 'cin' was not declared in this scope
6 | cin >> M[i];
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:16:25: error: 'cout' was not declared in this scope
16 | cout << i << endl;
| ^~~~
a.cc:16:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:38: error: 'endl' was not declared in this scope
16 | cout << i << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
|
s788736806 | p00434 | C++ | a = [False for i in range(31)]
for i in range(30):
x = int(input())
a[x] = True
for i in range(1, 30):
if a[i] == False:
print(i) | a.cc:1:1: error: 'a' does not name a type
1 | a = [False for i in range(31)]
| ^
|
s333036358 | p00434 | C++ | #include<iostream>
using namespace std ;
int main()
{
short num[ 30 ] ;
short suu[ 30 ] ;
for( short i = 0 ; i < 30 ; i++ )
{
cin >> num[ i ]
for( short j = 1 ; j <= 30 ; j++ )
{
if( num[ i ] == j )
{
suu[ i ] = 0 ;
}
}
}
for( short i = 0 ; i < 30 ; i++ )
{
if( num[ i ] != 0 )
{
cout << i + 1 << endl ;
}
}
return 0 ;
} | a.cc: In function 'int main()':
a.cc:9:32: error: expected ';' before 'for'
9 | cin >> num[ i ]
| ^
| ;
10 | for( short j = 1 ; j <= 30 ; j++ )
| ~~~
a.cc:10:36: error: 'j' was not declared in this scope
10 | for( short j = 1 ; j <= 30 ; j++ )
| ^
|
s402842491 | p00434 | C++ | #include<iostream>
using namespace std ;
int main()
{
short num[ 30 ] ;
short suu[ 30 ] ;
for( int i = 0 ; i < 30 ; i++ )
{
cin >> num[ i ]
for( int j = 1 ; j <= 30 ; j++ )
{
if( num[ i ] == j )
{
suu[ i ] = 0 ;
}
}
}
for( int i = 0 ; i < 30 ; i++ )
{
if( num[ i ] != 0 )
{
cout << i + 1 << endl ;
}
}
return 0 ;
} | a.cc: In function 'int main()':
a.cc:9:32: error: expected ';' before 'for'
9 | cin >> num[ i ]
| ^
| ;
10 | for( int j = 1 ; j <= 30 ; j++ )
| ~~~
a.cc:10:34: error: 'j' was not declared in this scope
10 | for( int j = 1 ; j <= 30 ; j++ )
| ^
|
s001013532 | p00434 | C++ | 3
9
1
30
4
6
5
12
7
10
9
20
6
21
10
11
11
7
12
5
13
28
14
4
15
18
16
29
17
17
18
19
19
27
20
13
21
16
22
26
23
14
24
23
25
22
26
15
27
3
28
1
29
24
30
25 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 3
| ^
|
s217908689 | p00434 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
int main() {
std::vector<int> vec(28);
for (int i = 0; i < 28; ++i)std::cin >> vec[i];
std::sort(vec.begin(), vec.end());
for (int i = 30; i >0; --i) {
if (num[i] != i) { std::cout << i << std::endl; i--; }
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:21: error: 'num' was not declared in this scope; did you mean 'enum'?
9 | if (num[i] != i) { std::cout << i << std::endl; i--; }
| ^~~
| enum
|
s112147540 | p00434 | C++ | #include <vector>
#include <algorithm>
using namespace std;
int main() {
int n,h,num,count,m,sum;
vector<int> v;
cin >> n;
num = 1;
count = 0;
for(int i = 0;i<n;++i){
cin>>h;
v.push_back(h);
}
sort(v.begin(),v.end());
for(int e : v){
if(e == num){
++num;
}
else {
cout<<num<<endl
++num;
++count;
if(e == num){
++num;
}
else {
cout<<num<<endl;
break;
}
}
if(count == 2){
break;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope
10 | cin >> n;
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include <algorithm>
+++ |+#include <iostream>
3 |
a.cc:26:7: error: 'cout' was not declared in this scope
26 | cout<<num<<endl
| ^~~~
a.cc:26:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:18: error: 'endl' was not declared in this scope
26 | cout<<num<<endl
| ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
2 | #include <algorithm>
+++ |+#include <ostream>
3 |
|
s177752091 | p00434 | C++ | include <stdio.h>
int main(){
int i1[28]={};
int i2[30] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30};
for(int i = 0; i < 28; i++) scanf("%d",&i1[i]);
for(int i:i1) for(int j:i2) if(i == j) i2[j-1] = 0;
for(int i:i2) if(i) printf("%d\n",i);
} | a.cc:1:1: error: 'include' does not name a type
1 | include <stdio.h>
| ^~~~~~~
|
s879252461 | p00434 | C++ | #include<iostream>
#include<string>
using namespace std;
int main() {
int count[31] = { 0 }, n, i;
for (i = 1; i <= 28; i++)
{
cin >> n;
count[n] = 1;
}
for (i = 1; i < =30; i++)
{
if (count[i] == 0)
{
cout << i << endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:11:21: error: expected primary-expression before '=' token
11 | for (i = 1; i < =30; i++)
| ^
|
s161964246 | p00434 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int stu[28];
int stusum = 0;
int sum = 0;
int Nostu[2];
for (int i = 0; i < 28; i++){
cin >> stu[i];
stusum += stu[i];
}
for (i = 1; i <= 30; i++){
sum += i;
}
sort(stu, stu + 28);
for (int j = 1; j <= 30; j++){
if (stu[j] != j){
Nostu[0] = j;
}
}
int n = (sum - stusum) - j;
cout << j << endl;
cout << n << endl;
return (0);
} | a.cc: In function 'int main()':
a.cc:17:10: error: 'i' was not declared in this scope
17 | for (i = 1; i <= 30; i++){
| ^
a.cc:29:30: error: 'j' was not declared in this scope
29 | int n = (sum - stusum) - j;
| ^
|
s494116421 | p00434 | C++ | #include <stdio.h>
#include <stdlib.h>
#define N 256
int who[2];
int compar(const int *val1,const int *val2){
if(*val1<*val2){
return -1;
}
else if(*val1== *val2){
return 0;
}
else{
return 1;
}
}
void detect(const int *pnt) {
int i = 1, j = 0;
int count = 0;
while (1) {
if (i != pnt[j]) {
who[count] = i;
count++;
i++;
if (count == 2) {
break;
}
}
else {
i++;
j++;
}
}
}
int main(void) {
int stdntID[5];
int i,j;
for (i = 0; i<5; i++) {
scanf("%d", &stdntID[i]);
}
qsort(stdntID,5,sizeof(int),compar);
detect(stdntID);
printf("%d\n", who[0]);
printf("%d\n", who[1]);
return 0;
}
| a.cc: In function 'int main()':
a.cc:44:37: error: invalid conversion from 'int (*)(const int*, const int*)' to '__compar_fn_t' {aka 'int (*)(const void*, const void*)'} [-fpermissive]
44 | qsort(stdntID,5,sizeof(int),compar);
| ^~~~~~
| |
| int (*)(const int*, const int*)
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/stdlib.h:36,
from a.cc:2:
/usr/include/stdlib.h:971:34: note: initializing argument 4 of 'void qsort(void*, size_t, size_t, __compar_fn_t)'
971 | __compar_fn_t __compar) __nonnull ((1, 4));
| ~~~~~~~~~~~~~~^~~~~~~~
|
s878532955 | p00434 | C++ | #include <stdio.h>
#include <stdlib.h>
int who[2];
int compar(const int *val1,const int *val2){
if(*val1<*val2){
return -1;
}
else if(*val1== *val2){
return 0;
}
else{
return 1;
}
}
void detect(const int *pnt) {
int i = 1, j = 0;
int count = 0;
while (1) {
if (i != pnt[j]) {
who[count] = i;
count++;
i++;
if (count == 2) {
break;
}
}
else {
i++;
j++;
}
}
}
int main(void) {
int stdntID[28];
int i,j;
for (i = 0; i<28; i++) {
scanf("%d", &stdntID[i]);
}
qsort(stdntID,5,sizeof(int),compar);
detect(stdntID);
printf("%d\n", who[0]);
printf("%d\n", who[1]);
return 0;
}
| a.cc: In function 'int main()':
a.cc:42:37: error: invalid conversion from 'int (*)(const int*, const int*)' to '__compar_fn_t' {aka 'int (*)(const void*, const void*)'} [-fpermissive]
42 | qsort(stdntID,5,sizeof(int),compar);
| ^~~~~~
| |
| int (*)(const int*, const int*)
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/stdlib.h:36,
from a.cc:2:
/usr/include/stdlib.h:971:34: note: initializing argument 4 of 'void qsort(void*, size_t, size_t, __compar_fn_t)'
971 | __compar_fn_t __compar) __nonnull ((1, 4));
| ~~~~~~~~~~~~~~^~~~~~~~
|
s479222272 | p00434 | C++ | <?php
$student = array();
for($i = 0; $i < 28; $i++) {
$students[] = trim(fgets(STDIN));
}
$all_students = range(1, 30);
$not_submitter = array_diff($all_students, $students);
sort($not_submitter);
echo implode("\r\n", $not_submitter);
| a.cc:1:1: error: expected unqualified-id before '<' token
1 | <?php
| ^
a.cc:3:5: error: expected unqualified-id before 'for'
3 | for($i = 0; $i < 28; $i++) {
| ^~~
a.cc:3:17: error: '$i' does not name a type
3 | for($i = 0; $i < 28; $i++) {
| ^~
a.cc:3:26: error: '$i' does not name a type
3 | for($i = 0; $i < 28; $i++) {
| ^~
a.cc:6:5: error: '$all_students' does not name a type
6 | $all_students = range(1, 30);
| ^~~~~~~~~~~~~
a.cc:7:5: error: '$not_submitter' does not name a type
7 | $not_submitter = array_diff($all_students, $students);
| ^~~~~~~~~~~~~~
a.cc:8:9: error: expected constructor, destructor, or type conversion before '(' token
8 | sort($not_submitter);
| ^
a.cc:9:5: error: 'echo' does not name a type
9 | echo implode("\r\n", $not_submitter);
| ^~~~
|
s818532932 | p00434 | C++ | #include<cstdio>
int main(){
int a[30],b;
memset(a,0,sizeof(int)*30);
for(int i=0;i<30;i++){
scanf("%d",&b);
a[b]=1;
}
for(int i=0;i<30;i++) if(a[i]==0) printf("%d\n",i);
return 0;
} | a.cc: In function 'int main()':
a.cc:5:1: error: 'memset' was not declared in this scope
5 | memset(a,0,sizeof(int)*30);
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<cstdio>
+++ |+#include <cstring>
2 |
|
s575871574 | p00434 | C++ | #include<cstdio>
#include<cstdlib>
int main(){
int a[30],b;
memset(a,0,sizeof(int)*30);
for(int i=0;i<30;i++){
scanf("%d",&b);
a[b]=1;
}
for(int i=0;i<30;i++) if(a[i]==0) printf("%d\n",i);
return 0;
} | a.cc: In function 'int main()':
a.cc:5:1: error: 'memset' was not declared in this scope
5 | memset(a,0,sizeof(int)*30);
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<cstdlib>
+++ |+#include <cstring>
3 | int main(){
|
s057692881 | p00434 | C++ | #include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
int main() {
int std[30];
memset(std,0,sizeof(std))
for (int i=0; i<28; i++) {
int a; cin >> a;
std[a] = 1;
}
for (int i=1; i<31; i++) {
if (!std[i-1]) cout << i << endl;
}
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'memset' was not declared in this scope
9 | memset(std,0,sizeof(std))
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <cstdio>
+++ |+#include <cstring>
4 |
a.cc:10:23: error: 'i' was not declared in this scope
10 | for (int i=0; i<28; i++) {
| ^
|
s388928316 | p00434 | C++ | #include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
int main() {
int std[30];
memset(std,0,sizeof(std));
for (int i=0; i<28; i++) {
int a; cin >> a;
std[a] = 1;
}
for (int i=1; i<31; i++) {
if (!std[i-1]) cout << i << endl;
}
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'memset' was not declared in this scope
9 | memset(std,0,sizeof(std));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <cstdio>
+++ |+#include <cstring>
4 |
|
s395458464 | p00434 | C++ | #include <iostream>
int main(){
int buf;
bool stud[30];
for(int i = 0; i < 30; i++){
stud[i] = 0;
}
for(int i = 0; i < 28; i++){
cin >> buf;
stud[buf] = 1;
}
for(int i = 0; i < 30; i++){
if(stud[i] == 0){
cout << i << endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
12 | cin >> buf;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:18:25: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
18 | cout << i << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:18:38: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
18 | cout << i << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s004707941 | p00434 | C++ | #include<iostream>
using namespace std;
int main()
{
bool ok[31];
memset(ok,false,sizeof(ok));
ok[0]=true;
for(int i=0;i<28;i++){
int t;
cin>>t;
ok[t]=true;
}
for(int i=0;i<30;i++)
if(!ok[i])
cout<<i<<endl;
} | a.cc: In function 'int main()':
a.cc:7:1: error: 'memset' was not declared in this scope
7 | memset(ok,false,sizeof(ok));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include <cstring>
2 | using namespace std;
|
s355255490 | p00434 | C++ | t i = 1 ; i <= 30 ; i++ ){
if(a[i]==false)cout<<i<<endl;
}
}
} | a.cc:1:1: error: 't' does not name a type
1 | t i = 1 ; i <= 30 ; i++ ){
| ^
a.cc:1:11: error: 'i' does not name a type
1 | t i = 1 ; i <= 30 ; i++ ){
| ^
a.cc:1:21: error: 'i' does not name a type
1 | t i = 1 ; i <= 30 ; i++ ){
| ^
a.cc:4:3: error: expected declaration before '}' token
4 | }
| ^
a.cc:5:1: error: expected declaration before '}' token
5 | }
| ^
|
s503061283 | p00434 | C++ | t i = 1 ; i <= 30 ; i++ ){
if(a[i]==false)cout<<i<<endl;
}
}
} | a.cc:1:1: error: 't' does not name a type
1 | t i = 1 ; i <= 30 ; i++ ){
| ^
a.cc:1:11: error: 'i' does not name a type
1 | t i = 1 ; i <= 30 ; i++ ){
| ^
a.cc:1:21: error: 'i' does not name a type
1 | t i = 1 ; i <= 30 ; i++ ){
| ^
a.cc:4:3: error: expected declaration before '}' token
4 | }
| ^
a.cc:5:1: error: expected declaration before '}' token
5 | }
| ^
|
s819081208 | p00434 | C++ | #include<stdio.h>
void main()
{
int i,j;
int lasa[28];
int value[31];
for(i=1;i<=30;i++)
{
value[i]=i;
}
for(i=0;i<29;i++)
{
scanf("%d\n",&lasa[i]);
}
for(i=0;i<29;i++)
{
for(j=1;j<31;j++)
{
if(lasa[i]==value[j])
{
value[j]=-1;
}
}
}
for(i=1;i<=30;i++)
{
if(value[i]>-1)
{
printf("%d\n",value[i]);
}
}
} | a.cc:2:1: error: '::main' must return 'int'
2 | void main()
| ^~~~
|
s495999141 | p00434 | C++ | /*
AOJ 0510 JOI yo 2005 2006 1 Who the student yet to submit
*/
//ミスを防ぐためにまずは基本のIncludeをすべて格納する
#include<fstream>
#include<string>
#include<queue>
#include<algorithm>
#include<set>
#include<map>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<vector>
#define INF (1<<21)
using namespace std;
typedef pair<int,int> P;
//ここまで基本型、多少の変更はあるけどまあいける
int main()
{
int a[30] = {0};//全要素を0で初期化
for (int i=0,i<30,i++){
int n;
cin >> n;
a[n]=1;
}
int m=1;
int yet1,yet2;
do{
if (a[m]>1 || a[m]<1) {
yet1=m;
break;
}
m++;
} while(m==30);
int n = m+1
do{
if (a[n]>1||a[n]<1){
yet2=n;
break;
}
n++;
}while(n==30);
int koukan;
if (yet2>yet1){
koukan=yet1;
yet1=yet2;
yet2=yet1;
}
cout << yet1<<endl<<yet2<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:28:23: error: expected ';' before '<' token
28 | for (int i=0,i<30,i++){
| ^
| ;
a.cc:28:23: error: expected primary-expression before '<' token
a.cc:28:30: error: expected ';' before ')' token
28 | for (int i=0,i<30,i++){
| ^
| ;
a.cc:31:17: error: 'cin' was not declared in this scope
31 | cin >> n;
| ^~~
a.cc:17:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
16 | #include<cstdio>
+++ |+#include <iostream>
17 | #include<vector>
a.cc:51:9: error: expected ',' or ';' before 'do'
51 | do{
| ^~
a.cc:68:9: error: 'cout' was not declared in this scope
68 | cout << yet1<<endl<<yet2<<endl;
| ^~~~
a.cc:68:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
|
s652575477 | p00434 | C++ | #include <iostream>
using namespace std;
int main(){
int n,num[29];
for(int i=0;i<28;i++){
cin>>n;
num[i]=n;
}
sort(num,num+28);
for(int j=0;j<30;j++){
if(num[j]!=j+1){
cout<<j+1<<endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'sort' was not declared in this scope; did you mean 'short'?
9 | sort(num,num+28);
| ^~~~
| short
|
s105598551 | p00434 | C++ | using namespace std;
int main(){
int n,num[29];
for(int i=0;i<28;i++){
cin>>n;
num[i]=n;
}
sort(num,num+28);
int o=1;
for(int j=1;j<29;j++){
if(num[j-1]!=o){
cout<<o<<endl;
j=j-1;
}
o++;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:25: error: 'cin' was not declared in this scope
5 | cin>>n;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:8:9: error: 'sort' was not declared in this scope; did you mean 'short'?
8 | sort(num,num+28);
| ^~~~
| short
a.cc:12:41: error: 'cout' was not declared in this scope
12 | cout<<o<<endl;
| ^~~~
a.cc:12:41: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:50: error: 'endl' was not declared in this scope
12 | cout<<o<<endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
|
s015996611 | p00434 | C++ | include<iostream>
#include<algorithm>
using namespace std;
#define INF ( 1 << 30 )
int main(){
bool a[31] = {},b;
for(int i = 0 ; i < 28 ; i++ ) cin >> b, a[b] = true;
for(int i = 1 ; i < 31 ; i++ ) if(!a[i]) cout << i << endl;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164 | __is_null_pointer(std::nullptr_t)
| ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
159 | __is_null_pointer(_Type)
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'
164 | __is_null_pointer(std::nullptr_t)
| ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared
295 | template <typename _Tp, size_t = sizeof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared
984 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope
1451 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
63 | #include <bits/version.h>
+++ |+#include <cstddef>
64 |
/usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid
1451 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared
1453 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope
1454 | struct extent<_Tp[_Size], 0>
| ^~~~~
/usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid
1454 | struct extent<_Tp[_Size], 0>
| ^
/usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~
/usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid
1455 | : public integral_constant<size_t, _Size> { };
| ^
/usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid
/usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared
1457 | template<typename _Tp, unsigned _Uint, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope
1458 | struct extent<_Tp[_Size], _Uint>
| ^~~~~
/usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid
1458 | struct extent<_Tp[_Size], _Uint>
| ^
/usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope
1463 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid
1463 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type
1857 | { static constexpr size_t __size = sizeof(_Tp); };
| ^~~~~~
/usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~~~~
/usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~
/usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp'
1860 | struct __select;
| ^~~~~~~~
/usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared
1862 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^~~
/usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^
/usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared
1866 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
| ^~~
/usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
|
s746888115 | p00435 | C | #include <stdio.h>
int main(void){
char a[1000];
int i;
gets(a);
for(i=0;a[i]!='\0';i++){
if('D'<=a[i]&&a[i]<='Z')a[i]-=3;
else a[i]+=23;
}
puts(a);
return 0;
}
| main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
5 | gets(a);
| ^~~~
| fgets
|
s807368046 | p00435 | C | #include <stdio.h>
#include <string.h>
int main(){
char moji[1001];
int i,m;
scanf("%s",moji);
for(i=0;i<=strlen(moji);i++){
if(moji[i]>='D'){
moji[m]=moji[i]-3;
printf("%c",moji[m]);
} else{
moji[m]=moji[i]+23;
printf("%c",moji[i]+23);
}
printf("\n");
return 0;
} | main.c: In function 'main':
main.c:19:1: error: expected declaration or statement at end of input
19 | }
| ^
|
s823157720 | p00435 | C | #include<stdio.h>
int main(){
char ch[1001];
int i=0;
scanf("%s",ch);
while(1){
if(ch[i]=='?\0'){
printf("?\n");
break;
}
if(ch[i]>='D') ch[i]-=3; else if(ch[i]=='C') ch[i]='Z'; else if(ch[i]=='B') ch[i]='Y'; else if(ch[i]=='A') Ch[i]=='X';
printf("%c",ch[i]);
i++;
}
return 0;
} | main.c: In function 'main':
main.c:7:11: warning: multi-character character constant [-Wmultichar]
7 | if(ch[i]=='?\0'){
| ^~~~~
main.c:11:108: error: 'Ch' undeclared (first use in this function); did you mean 'ch'?
11 | if(ch[i]>='D') ch[i]-=3; else if(ch[i]=='C') ch[i]='Z'; else if(ch[i]=='B') ch[i]='Y'; else if(ch[i]=='A') Ch[i]=='X';
| ^~
| ch
main.c:11:108: note: each undeclared identifier is reported only once for each function it appears in
|
s669239760 | p00435 | C | #include<stdio.h>
int main(){
char ch[1001];
int i=0;
scanf("%s",&ch);
while(1){
if(ch[i]=='?\0'){
printf("?\n");
break;
}
if(ch[i]>='D') ch[i]-=3; else if(ch[i]=='C') ch[i]='Z'; else if(ch[i]=='B') ch[i]='Y'; else if(ch[i]=='A') Ch[i]=='X';
printf("%c",ch[i]);
i++;
}
return 0;
} | main.c: In function 'main':
main.c:7:11: warning: multi-character character constant [-Wmultichar]
7 | if(ch[i]=='?\0'){
| ^~~~~
main.c:11:108: error: 'Ch' undeclared (first use in this function); did you mean 'ch'?
11 | if(ch[i]>='D') ch[i]-=3; else if(ch[i]=='C') ch[i]='Z'; else if(ch[i]=='B') ch[i]='Y'; else if(ch[i]=='A') Ch[i]=='X';
| ^~
| ch
main.c:11:108: note: each undeclared identifier is reported only once for each function it appears in
|
s161415116 | p00435 | C | #include<stdio.h>
int main(void){
char moji[1000]
int i,j;
scanf("%s\n",&moji[i]);
for(j=1; j=<i; j++){
if(moji[i]==A){
moji[i]=X;
}else if(moji[i]==B){
moji[i]=Y;
}else if(moji[i]==C){
moji[i]=Z;
}else if(moji[i]==D){
moji[i]=A;
}else if(moji[i]==E){
moji[i]=B;
}else if(moji[i]==F){
moji[i]=C;
}else if(moji[i]==G){
moji[i]=D;
}else if(moji[i]==H){
moji[i]=E;
}else if(moji[i]==I){
moji[i]=F;
}else if(moji[i]==J){
moji[i]=G;
}else if(moji[i]==K){
moji[i]=H;
}else if(moji[i]==L){
moji[i]=I;
}else if(moji[i]==M){
moji[i]=J;
}else if(moji[i]==N){
moji[i]=K;
}else if(moji[i]==O)[
moji[i]=L;
}else if(moji[i]==P){
moji[i]=M;
}else if(moji[i]==Q){
moji[i]=N;
}else if(moji[i]==R){
moji[i]=O;
}else if(moji[i]==S){
moji[i]=P;
}else if(moji[i]==T){
moji[i]=Q;
}else if(moji[i]==U){
moji[i]=R;
}else if(moji[i]==V){
moji[i]=S;
}else if(moji[i]==W){
moji[i]=T;
}else if(moji[i]==X){
moji[i]=U;
}else if(moji[i]==Y){
moji[i]=V;
}else if(moji[i]==Z){
moji[i]=W;
}
printf("%s",moji[i]);
return 0;
} | main.c: In function 'main':
main.c:3:18: error: expected ';' before 'int'
3 | char moji[1000]
| ^
| ;
4 | int i,j;
| ~~~
main.c:5:17: error: 'moji' undeclared (first use in this function)
5 | scanf("%s\n",&moji[i]);
| ^~~~
main.c:5:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:14: error: expected expression before '<' token
6 | for(j=1; j=<i; j++){
| ^
main.c:8:15: error: 'A' undeclared (first use in this function)
8 | if(moji[i]==A){
| ^
main.c:9:15: error: 'X' undeclared (first use in this function)
9 | moji[i]=X;
| ^
main.c:10:21: error: 'B' undeclared (first use in this function)
10 | }else if(moji[i]==B){
| ^
main.c:11:15: error: 'Y' undeclared (first use in this function)
11 | moji[i]=Y;
| ^
main.c:12:21: error: 'C' undeclared (first use in this function)
12 | }else if(moji[i]==C){
| ^
main.c:13:15: error: 'Z' undeclared (first use in this function)
13 | moji[i]=Z;
| ^
main.c:14:21: error: 'D' undeclared (first use in this function)
14 | }else if(moji[i]==D){
| ^
main.c:16:21: error: 'E' undeclared (first use in this function)
16 | }else if(moji[i]==E){
| ^
main.c:18:21: error: 'F' undeclared (first use in this function)
18 | }else if(moji[i]==F){
| ^
main.c:20:21: error: 'G' undeclared (first use in this function)
20 | }else if(moji[i]==G){
| ^
main.c:22:21: error: 'H' undeclared (first use in this function)
22 | }else if(moji[i]==H){
| ^
main.c:24:21: error: 'I' undeclared (first use in this function)
24 | }else if(moji[i]==I){
| ^
main.c:26:21: error: 'J' undeclared (first use in this function)
26 | }else if(moji[i]==J){
| ^
main.c:28:21: error: 'K' undeclared (first use in this function)
28 | }else if(moji[i]==K){
| ^
main.c:30:21: error: 'L' undeclared (first use in this function)
30 | }else if(moji[i]==L){
| ^
main.c:32:21: error: 'M' undeclared (first use in this function)
32 | }else if(moji[i]==M){
| ^
main.c:34:21: error: 'N' undeclared (first use in this function)
34 | }else if(moji[i]==N){
| ^
main.c:36:21: error: 'O' undeclared (first use in this function)
36 | }else if(moji[i]==O)[
| ^
main.c:36:23: error: expected expression before '[' token
36 | }else if(moji[i]==O)[
| ^
main.c:37:17: error: expected ';' before '}' token
37 | moji[i]=L;
| ^
| ;
38 | }else if(moji[i]==P){
| ~
main.c:38:4: error: 'else' without a previous 'if'
38 | }else if(moji[i]==P){
| ^~~~
main.c:38:21: error: 'P' undeclared (first use in this function)
38 | }else if(moji[i]==P){
| ^
main.c:40:21: error: 'Q' undeclared (first use in this function)
40 | }else if(moji[i]==Q){
| ^
main.c:42:21: error: 'R' undeclared (first use in this function)
42 | }else if(moji[i]==R){
| ^
main.c:44:21: error: 'S' undeclared (first use in this function)
44 | }else if(moji[i]==S){
| ^
main.c:46:21: error: 'T' undeclared (first use in this function)
46 | }else if(moji[i]==T){
| ^
main.c:48:21: error: 'U' undeclared (first use in this function)
48 | }else if(moji[i]==U){
| ^
main.c:50:21: error: 'V' undeclared (first use in this function)
50 | }else if(moji[i]==V){
| ^
main.c:52:21: error: 'W' undeclared (first use in this function)
52 | }else if(moji[i]==W){
| ^
|
s596057054 | p00435 | C | include <stdio.h>
char aft[1000];
int n, j;
void change(char aft[1000]){
int a;
for (a = 0;aft[a] != NULL;a++) {
switch (aft[a]) {
case'A':aft[a] = 'D';break;
case'B':aft[a] = 'E';break;
case'C':aft[a] = 'F';break;
case'D':aft[a] = 'G';break;
case'E':aft[a] = 'H';break;
case'F':aft[a] = 'I';break;
case'G':aft[a] = 'J';break;
case'H':aft[a] = 'K';break;
case'I':aft[a] = 'L';break;
case'J':aft[a] = 'M';break;
case'K':aft[a] = 'N';break;
case'L':aft[a] = 'O';break;
case'M':aft[a] = 'P';break;
case'N':aft[a] = 'Q';break;
case'O':aft[a] = 'R';break;
case'P':aft[a] = 'S';break;
case'Q':aft[a] = 'T';break;
case'R':aft[a] = 'U';break;
case'S':aft[a] = 'V';break;
case'T':aft[a] = 'W';break;
case'U':aft[a] = 'X';break;
case'V':aft[a] = 'Y';break;
case'W':aft[a] = 'Z';break;
case'X':aft[a] = 'A';break;
case'Y':aft[a] = 'B';break;
case'Z':aft[a] = 'C';break;
}
}
int main()
{
scanf("%s", &aft);
printf("%s\n",change(aft));
return 0;
} | main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
main.c: In function 'change':
main.c:8:38: error: 'NULL' undeclared (first use in this function)
8 | for (a = 0;aft[a] != NULL;a++) {
| ^~~~
main.c:1:1: note: 'NULL' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
+++ |+#include <stddef.h>
1 | include <stdio.h>
main.c:8:38: note: each undeclared identifier is reported only once for each function it appears in
8 | for (a = 0;aft[a] != NULL;a++) {
| ^~~~
main.c: In function 'main':
main.c:41:25: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
41 | scanf("%s", &aft);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | include <stdio.h>
main.c:41:25: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
41 | scanf("%s", &aft);
| ^~~~~
main.c:41:25: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:42:25: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
42 | printf("%s\n",change(aft));
| ^~~~~~
main.c:42:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:42:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:42:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:42:39: error: invalid use of void expression
42 | printf("%s\n",change(aft));
| ^~~~~~~~~~~
main.c: In function 'change':
main.c:44:17: error: expected declaration or statement at end of input
44 | }
| ^
|
s028154241 | p00435 | C | #include<stdio.h>
#include<string.h>
int main(void)
{
char str[1001];
int i;
scanf_s("%s",str);
for (i = 0; i < strlen(str); i++) {
if (str[i] >= 'A' && str[i] <= 'Z') {
str[i] = (str[i] - 'A' - 3) % 26 + 'A';
}
}
printf("%s\n",str);
return 0;
} | main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
8 | scanf_s("%s",str);
| ^~~~~~~
| scanf
|
s934210000 | p00435 | C | 1 #include <stdio.h>
2
3 int main(){
4 char ch = 'a';
5 int i;
6
7 while(ch != '\n'){
8 scanf("%c", &ch);
9 ch + 3;
10 printf("%c", ch);
11
12 }
13
14 printf("\n");
15 return 0;
16 }
~
~
~
~
~ | main.c:1:3: error: expected identifier or '(' before numeric constant
1 | 1 #include <stdio.h>
| ^
main.c:1:5: error: stray '#' in program
1 | 1 #include <stdio.h>
| ^
main.c:17:1: error: expected identifier or '(' before '~' token
17 | ~
| ^
|
s132531902 | p00435 | C | 1 #include <stdio.h>
2
3 int main(){
4 char ch = 'a';
5 int i;
6
7 while(ch != '\n'){
8 scanf("%c", &ch);
9 ch + 3;
10 printf("%c", ch);
11
12 }
13
14 printf("\n");
15 return 0;
16 }
~
~
~
~
~ | main.c:1:3: error: expected identifier or '(' before numeric constant
1 | 1 #include <stdio.h>
| ^
main.c:1:5: error: stray '#' in program
1 | 1 #include <stdio.h>
| ^
main.c:17:1: error: expected identifier or '(' before '~' token
17 | ~
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.