criyle/codenet-compile-errors huggingface dataset:
Language: Java


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Dice dice = new Dice();
		int x1 = sc.nextInt();
		int x2 = sc.nextInt();
		int x3 = sc.nextInt();
		int x4 = sc.nextInt();
		int x5 = sc.nextInt();
		int x6 = sc.nextInt();
		String temp = sc.next();
		dice.setSurf(x1, x2, x3, x4, x5, x6);
		char order[] = temp.toCharArray();
		for (int i = 0; i < order.length; i++) {
			if (order[i] == 'N')
				dice.rollN();
			else if (order[i] == 'S')
				dice.rollS();
			else if (order[i] == 'E')
				dice.rollE();
			else if (order[i] == 'W')
				dice.rollW();
		}
		System.out.println(dice.getSurf1());
	}
}


Compiler output:
Main.java:7: error: cannot find symbol
		Dice dice = new Dice();
		^
  symbol:   class Dice
  location: class Main
Main.java:7: error: cannot find symbol
		Dice dice = new Dice();
		                ^
  symbol:   class Dice
  location: class Main
2 errors
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        Dice dice = new Dice();

        for(int i = 0; i < 6; i++){
            dice.setNum(i, scanner.nextInt());
        }

        String command = scanner.next();
        for(String cmd : command.split("")){
            dice.move(cmd);
        }

        System.out.println(dice.getNum(0));

        scanner.close();
    }
}

public class Dice {
    private int[] surface = new int[6];

    public void setNum(int index, int num){
        this.surface[index] = num;
    }

    public int getNum(int index){
        return this.surface[index];
    }

    public void move(String vector){
        int sub = 0;
        if(vector.equals("E")){
            sub = this.surface[0];
            this.surface[0] = this.surface[3];
            this.surface[3] = this.surface[5];
            this.surface[5] = this.surface[2];
            this.surface[2] = sub;

        }else if(vector.equals("W")){
            sub = this.surface[0];
            this.surface[0] = this.surface[2];
            this.surface[2] = this.surface[5];
            this.surface[5] = this.surface[3];
            this.surface[3] = sub;

        }else if(vector.equals("N")){
            sub = this.surface[0];
            this.surface[0] = this.surface[1];
            this.surface[1] = this.surface[5];
            this.surface[5] = this.surface[4];
            this.surface[4] = sub;
        }else if(vector.equals("S")){
            sub = this.surface[0];
            this.surface[0] = this.surface[4];
            this.surface[4] = this.surface[5];
            this.surface[5] = this.surface[1];
            this.surface[1] = sub;
        }
    }
}




Compiler output:
Main.java:23: error: class Dice is public, should be declared in a file named Dice.java
public class Dice {
       ^
1 error
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		Dice dice=new Dice(scan.nextInt(),scan.nextInt(),scan.nextInt(),scan.nextInt(),scan.nextInt(),scan.nextInt());
		String str=scan.next();
		for(int i=0;i<str.length();i++) {
		if(str.equals('E')) {
			dice.TrunE();
		}else if(str.equals('W')) {
			dice.TrunW();
		}else if(str.equals('S')) {
			dice.TrunS();
		}else if(str.equals('N')) {
			dice.TrunN();
		}else {
			
		}
		}
}

class Dice{
	int Top;
	int E;
	int W;
	int S;
	int N;
	int bottom;
	Dice(int a,int b,int c,int d,int e,int f){
		Top=a;
		E=c;
		W=d;
		S=b;
		N=e;
		bottom=f;
	}
	public void TrunE() {
		Top=W;
		W=bottom;
		bottom=E;
		E=Top;
	}public void TrunW() {
		Top=E;
		E=bottom;
		bottom=W;
		W=Top;
	}public void TrunS() {
		Top=N;
		N=bottom;
		bottom=S;
		S=Top;
	}public void TrunN() {
		Top=S;
		S=bottom;
		bottom=N;
		N=Top;
	}
}


Compiler output:
Main.java:59: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		Dice dice=new Dice(scan.nextInt(),scan.nextInt(),scan.nextInt(),scan.nextInt(),scan.nextInt(),scan.nextInt());
		String str=scan.next();
		for(int i=0;i<str.length();i++) {
			char a=str.charAt(i);
		if(a=='W') {
			dice.TrunE();
		}else if(a=='W') {
			dice.TrunW();
		}else if(a=='S') {
			dice.TrunS();
		}else if(a=='N') {
			dice.TrunN();
		}else {
			System.out.println("入力ミス");
		}
		}
		System.out.println(dice.Top);
}

class Dice{
	int Top;
	int E;
	int W;
	int S;
	int N;
	int bottom;
	Dice(int a,int b,int c,int d,int e,int f){
		Top=a;
		E=c;
		W=d;
		S=b;
		N=e;
		bottom=f;
	}
	public void TrunE() {
		Top=W;
		W=bottom;
		bottom=E;
		E=Top;
	}public void TrunW() {
		Top=E;
		E=bottom;
		bottom=W;
		W=Top;
	}public void TrunS() {
		Top=N;
		N=bottom;
		bottom=S;
		S=Top;
	}public void TrunN() {
		Top=S;
		S=bottom;
		bottom=N;
		N=Top;
	}
}
}


Compiler output:
Main.java:6: error: non-static variable this cannot be referenced from a static context
		Dice dice=new Dice(scan.nextInt(),scan.nextInt(),scan.nextInt(),scan.nextInt(),scan.nextInt(),scan.nextInt());
		          ^
1 error
Language: Java

import java.util.Scanner;

class Dice{
	public int Top;
	public int Front;
	public int Right;
	public int left;
	public int Back;
	public int Bottom;

	public void SC() {
		Scanner sc = new Scanner(System.in);
		Top = sc.nextInt();
		Front = sc.nextInt();
		Right = sc.nextInt();
		left = sc.nextInt();
		Back = sc.nextInt();
		Bottom = sc.nextInt();
		sc.close();
	}
	public void W(Dice st) {
		Top = st.Right;
		Front = st.Front;
		Right = st.Bottom;
		left = st.Top;
		Back = st.Back;
		Bottom = st.left;
	}
	public void E(Dice st) {
		Top = st.left;
		Front = st.Front;
		Right = st.Top;
		left = st.Bottom;
		Back = st.Back;
		Bottom = st.Right;
	}

	public void S(Dice st) {
		Top = st.Back;
		Front = st.Top;
		Right = st.Right;
		left = st.left;
		Back = st.Bottom;
		Bottom = st.Front;
	}

	public void N(Dice st) {
		Top = st.Front;
		Front = st.Bottom;
		Right = st.Right;
		left = st.left;
		Back = st.Top;
		Bottom = st.Back;
	}
}


public class s10 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Dice a = new Dice();
		Dice st = new Dice();
		a.SC();
		st = a;
		String str = sc.next();

		char data[] = new char[str.length()];
		data = str.toCharArray();
		for(int i=0;i<str.length();i++) {
			switch(data[i]) {
			case 'W':
				a.W(st);
				st = a;
				break;
			case'S':
				a.S(st);
				st = a;
				break;
			case'N':
				a.N(st);
				st = a;
				break;
			case'E':
				a.E(st);
				st = a;
				break;
			default:
				break;
			}
		}


		System.out.println(a.Top);

		sc.close();
	}
}




Compiler output:
Main.java:58: error: class s10 is public, should be declared in a file named s10.java
public class s10 {
       ^
1 error
Language: Java

package test;
import java.util.Scanner;

class Dice{
	public int Top;
	public int Front;
	public int Right;
	public int left;
	public int Back;
	public int Bottom;

	public Dice() {
		// TODO 自動生成されたコンストラクター・スタブ
	}
	public void W() {
		int Topch = Top;
		int leftch = left;
		Top = Right;
		Right = Bottom;
		left = Topch;
		Bottom = leftch;
	}
	public void E() {
		int Topch = Top;
		int Rightch = Right;
		Top = left;
		Right = Topch;
		left = Bottom;
		Bottom = Rightch;
	}

	public void S() {
		int Topch  =Top;
		int Frontch = Front;
		Top = Back;
		Front = Topch;
		Back = Bottom;
		Bottom = Frontch;
	}

	public void N() {
		int Topch = Top;
		int Backch = Back;
		Top = Front;
		Front = Bottom;
		Back = Topch;
		Bottom = Backch;
	}


}


public class sample2{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Dice a = new Dice();

		a.Top = sc.nextInt();
		a.Front = sc.nextInt();
		a.Right = sc.nextInt();
		a.left = sc.nextInt();
		a.Back = sc.nextInt();
		a.Bottom = sc.nextInt();
		String str = sc.next();

		char data[] = new char[str.length()];
		data = str.toCharArray();
		for(int i=0;i<str.length();i++) {
			switch(data[i]) {
			case 'W':
				a.W();
				break;
			case'S':
				a.S();
				break;
			case'N':
				a.N();
				break;
			case'E':
				a.E();
				break;
			default:
				break;
			}
		}


		System.out.println(a.Top);

		sc.close();
	}
}





Compiler output:
Main.java:54: error: class sample2 is public, should be declared in a file named sample2.java
public class sample2{
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

  public static void main(String[] args) throws IOException {
    
    try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      String line;
      while(true) {

        if( (line = br.readLine()) == null || line.isEmpty() ) break;

        Dice dice1 = new Dice(line.split(" "));
        System.out.println(dice1.doRotate(br.readLine()));
      }
    }
  }
}

class Dice {
  private int[] side;

  public Dice( int[] ia ) {
    side = Arrays.copyOf(ia, ia.length);
  }
  public Dice( String[] s ) {
    side = new int[s.length];
    for ( int i=0; i < 6; i++)
      side[i] = Integer.parseInt(diceNumStr[i]);
  }

  public int doRotate(String s) {
    for ( int i=0; i < s.length(); i++ ) {
      rotate(s.substring(i, i+1));
    }
    return side[0];
  }

  private void rotate(String o) {
    switch(o) {
      case "N" :
        rotateN();
        break;
      case "S" :
        rotateS();
        break;
      case "W" :
        rotateW();
        break;
      case "E":
        rotateE();
        break;
      default :
    }
  }

  private void rotateN() {
    int tmp = side[0];
    side[0] = side[1]; side[1] = side[5]; side[5] = side[4];
    side[5] = tmp;
  }
  private void rotateS() {
    int tmp = side[0];
    side[0] = side[4]; side[4] = side[5]; side[5] = side[1];
    side[1] = tmp;
  }
  private void rotateW() {
    int tmp = side[0];
    side[0] = side[2]; side[2] = side[5]; side[5] = side[3];
    side[3] = tmp;
  }
  private void rotateE() {
    int tmp = side[0];
    side[0] = side[3]; side[3] = side[5]; side[5] = side[2];
    side[2] = tmp;
  }
}


Compiler output:
Main.java:33: error: cannot find symbol
      side[i] = Integer.parseInt(diceNumStr[i]);
                                 ^
  symbol:   variable diceNumStr
  location: class Dice
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Dice {

	private String[] dice;

	private char[] move;

	private String[] over;

	public void setDice (String[] diceStr)
	{
		dice = new String[6];

		for(int num = 0; num < diceStr.length; num++)
			dice[num] = diceStr[num];
	}

	public String Move (char[] compass)
	{
		move = compass;

		//move.length回、転がす
		for(int kai = 0; kai < move.length; kai++)
		{
			over = new String[6];

			//東に転がす場合
			if(move[kai] == 'E')
			{
				over[0] = dice[3];
				over[1] = dice[1];
				over[2] = dice[0];
				over[3] = dice[5];
				over[4] = dice[4];
				over[5] = dice[2];

				for(int num = 0; num < over.length; num++)
					dice[num] = over[num];
			}

			//西に転がす場合
			else if(move[kai] == 'W')
			{
				over[0] = dice[2];
				over[1] = dice[1];
				over[2] = dice[5];
				over[3] = dice[0];
				over[4] = dice[4];
				over[5] = dice[3];

				for(int num = 0; num < over.length; num++)
					dice[num] = over[num];
			}

			//南に転がす場合
			else if(move[kai] == 'S')
			{
				over[0] = dice[4];
				over[1] = dice[0];
				over[2] = dice[2];
				over[3] = dice[3];
				over[4] = dice[5];
				over[5] = dice[1];

				for(int num = 0; num < over.length; num++)
					dice[num] = over[num];
			}

			//北に転がす場合
			else if(move[kai] == 'N')
			{
				over[0] = dice[1];
				over[1] = dice[5];
				over[2] = dice[2];
				over[3] = dice[3];
				over[4] = dice[0];
				over[5] = dice[4];

				for(int num = 0; num < over.length; num++)
					dice[num] = over[num];
			}
		}
		return dice[0];
	}
}

public class Main {
	public static void main (String[] args) throws IOException
	{
		BufferedReader input = new BufferedReader (new InputStreamReader (System.in));

		Dice dice = new Dice();

		dice.setDice(input.readLine().split(" "));

		String solution = dice.Move(input.readLine().toCharArray());

		System.out.println(solution);
	}
}



Compiler output:
Main.java:5: error: class Dice is public, should be declared in a file named Dice.java
public class Dice {
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main (String[] args) throws IOException
	{
		BufferedReader input = new BufferedReader (new InputStreamReader (System.in));

		Dice dice = new Dice();

		dice.setDice(input.readLine().split(" "));

		String solution = dice.Move(input.readLine().toCharArray());

		System.out.println(solution);
	}
}

public class Dice {

	private String[] dice;

	private char[] move;

	private String[] over;

	public void setDice (String[] diceStr)
	{
		dice = new String[6];

		for(int num = 0; num < diceStr.length; num++)
			dice[num] = diceStr[num];
	}

	public String Move (char[] compass)
	{
		move = compass;

		//move.length回、転がす
		for(int kai = 0; kai < move.length; kai++)
		{
			over = new String[6];

			//東に転がす場合
			if(move[kai] == 'E')
			{
				over[0] = dice[3];
				over[1] = dice[1];
				over[2] = dice[0];
				over[3] = dice[5];
				over[4] = dice[4];
				over[5] = dice[2];

				for(int num = 0; num < over.length; num++)
					dice[num] = over[num];
			}

			//西に転がす場合
			else if(move[kai] == 'W')
			{
				over[0] = dice[2];
				over[1] = dice[1];
				over[2] = dice[5];
				over[3] = dice[0];
				over[4] = dice[4];
				over[5] = dice[3];

				for(int num = 0; num < over.length; num++)
					dice[num] = over[num];
			}

			//南に転がす場合
			else if(move[kai] == 'S')
			{
				over[0] = dice[4];
				over[1] = dice[0];
				over[2] = dice[2];
				over[3] = dice[3];
				over[4] = dice[5];
				over[5] = dice[1];

				for(int num = 0; num < over.length; num++)
					dice[num] = over[num];
			}

			//北に転がす場合
			else if(move[kai] == 'N')
			{
				over[0] = dice[1];
				over[1] = dice[5];
				over[2] = dice[2];
				over[3] = dice[3];
				over[4] = dice[0];
				over[5] = dice[4];

				for(int num = 0; num < over.length; num++)
					dice[num] = over[num];
			}
		}
		return dice[0];
	}
}



Compiler output:
Main.java:20: error: class Dice is public, should be declared in a file named Dice.java
public class Dice {
       ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] num = new int[6];
		for (int i = 0; i < 6; i++) {
			num[i] = sc.nextInt();
		}
		Dice dice = new Dice(num);
		String str = sc.next();
		dice.order(str);
		System.out.println(dice.getFace());
		sc.close();
	}
}

public class Dice {

	private int face[] = new int[6];

	public void setFace(int[] face) {
		this.face = face;
	}

	Dice(int[] num) {
		for (int i = 0; i < 6; i++) {
			this.face[i] = num[i];
		}
	}

	void order(String str) {
		char[] order = str.toCharArray();
		for (int i = 0; i < order.length; i++) {
			switch (order[i]) {
			case 'N':
				north();
				break;
			case 'S':
				south();
				break;
			case 'E':
				east();
				break;
			case 'W':
				west();
				break;
			}
		}
	}

	void north() {
		int tmp;
		tmp = face[0];
		face[0] = face[1];
		face[1] = face[5];
		face[5] = face[4];
		face[4] = tmp;
	}

	void south() {
		int tmp;
		tmp = face[0];
		face[0] = face[4];
		face[4] = face[5];
		face[5] = face[1];
		face[1] = tmp;
	}

	void east() {
		int tmp;
		tmp = face[0];
		face[0] = face[3];
		face[3] = face[5];
		face[5] = face[2];
		face[2] = tmp;
	}

	void west() {
		int tmp;
		tmp = face[0];
		face[0] = face[2];
		face[2] = face[5];
		face[5] = face[3];
		face[3] = tmp;
	}

	public int getFace() {
		return face[0];
	}
}


Compiler output:
Main.java:18: error: class Dice is public, should be declared in a file named Dice.java
public class Dice {
       ^
1 error
Language: Java

import java.util.Scanner;

public class Main {

	private static int face[] = new int[6];

	static void dice(int[] num) {
		for (int i = 0; i < 6; i++) {
			Ex01Dice1.face[i] = num[i];
		}
	}

	static void order(String str) {
		char[] order = str.toCharArray();
		int tmp;
		for (int i = 0; i < order.length; i++) {
			switch (order[i]) {
			case 'N':
				tmp = face[0];
				face[0] = face[1];
				face[1] = face[5];
				face[5] = face[4];
				face[4] = tmp;
				break;
			case 'S':
				tmp = face[0];
				face[0] = face[4];
				face[4] = face[5];
				face[5] = face[1];
				face[1] = tmp;
				break;
			case 'E':
				tmp = face[0];
				face[0] = face[3];
				face[3] = face[5];
				face[5] = face[2];
				face[2] = tmp;
				break;
			case 'W':
				tmp = face[0];
				face[0] = face[2];
				face[2] = face[5];
				face[5] = face[3];
				face[3] = tmp;
				break;
			}
		}
	}

	public static int getFace() {
		return Ex01Dice1.face[0];
	}

	public static void setFace(int[] face) {
		Ex01Dice1.face = face;
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] num = new int[6];
		for (int i = 0; i < 6; i++) {
			num[i] = sc.nextInt();
		}
		Ex01Dice1.setFace(num);
		String str = sc.next();
		Ex01Dice1.order(str);
		System.out.println(Ex01Dice1.getFace());
		sc.close();
	}
}


Compiler output:
Main.java:9: error: cannot find symbol
			Ex01Dice1.face[i] = num[i];
			^
  symbol:   variable Ex01Dice1
  location: class Main
Main.java:51: error: cannot find symbol
		return Ex01Dice1.face[0];
		       ^
  symbol:   variable Ex01Dice1
  location: class Main
Main.java:55: error: cannot find symbol
		Ex01Dice1.face = face;
		^
  symbol:   variable Ex01Dice1
  location: class Main
Main.java:64: error: cannot find symbol
		Ex01Dice1.setFace(num);
		^
  symbol:   variable Ex01Dice1
  location: class Main
Main.java:66: error: cannot find symbol
		Ex01Dice1.order(str);
		^
  symbol:   variable Ex01Dice1
  location: class Main
Main.java:67: error: cannot find symbol
		System.out.println(Ex01Dice1.getFace());
		                   ^
  symbol:   variable Ex01Dice1
  location: class Main
6 errors
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] num = new int[6];
		Dice dice = new Dice(num);
		for (int i = 0; i < 6; i++) {
			num[i] = sc.nextInt();
		}
		dice.setFace(num);
		String str = sc.next();
		dice.order(str);
		System.out.println(dice.getFace());
		sc.close();
	}
}

public class Dice {
	private int face[] = new int[6];

	Dice(int[] num) {
		for (int i = 0; i < 6; i++) {
			this.face[i] = num[i];
		}
	}

	public void order(String str) {
		char[] order = str.toCharArray();
		for (int i = 0; i < order.length; i++) {
			switch (order[i]) {
			case 'N':
				rollToNorth();
				break;
			case 'S':
				rollToSouth();
				break;
			case 'E':
				rollToEast();
				break;
			case 'W':
				rollToWest();
				break;
			}
		}
	}

	public void rollToNorth() {
		int tmp;
		tmp = face[0];
		face[0] = face[1];
		face[1] = face[5];
		face[5] = face[4];
		face[4] = tmp;
	}

	public void rollToSouth() {
		int tmp;
		tmp = face[0];
		face[0] = face[4];
		face[4] = face[5];
		face[5] = face[1];
		face[1] = tmp;
	}

	public void rollToEast() {
		int tmp;
		tmp = face[0];
		face[0] = face[3];
		face[3] = face[5];
		face[5] = face[2];
		face[2] = tmp;
	}

	public void rollToWest() {
		int tmp;
		tmp = face[0];
		face[0] = face[2];
		face[2] = face[5];
		face[5] = face[3];
		face[3] = tmp;
	}

	public int getFace() {
		return face[0];
	}

	public void setFace(int[] face) {
		this.face = face;
	}
}


Compiler output:
Main.java:20: error: class Dice is public, should be declared in a file named Dice.java
public class Dice {
       ^
1 error
Language: C

#include<iostream>
using namespace std;

struct Directions
{
	int E[6] = { 2, 1, 5, 0, 4, 3 };
	int W[6] = { 3, 1, 0, 5, 4, 2 };
	int N[6] = { 4, 0, 2, 3, 5, 1 };
	int S[6] = { 1, 5, 2, 3, 0, 4 };
};

class Dice
{
private:
	int num[6];
	char dir_command[105];
	Directions dir_array;
	void swap(int*);
public:
	Dice();
	int condition(int);
	void roll(int);
	void show_top();
	void show_member();
};

Dice::Dice()
{
	Directions direction;
	for (int i = 0; i < 6; i++)
		cin >> this->num[i];
	cin >> this->dir_command;
}

int Dice::condition(int i)
{
	if (dir_command[i] == '\0')
		return 0;
	else
		return 1;
}

void Dice::roll(int i)
{
	switch (this->dir_command[i])
	{
	case 'E':
		this->swap(dir_array.E);
		break;
	case 'W':
		this->swap(dir_array.W);
		break;
	case 'N':
		this->swap(dir_array.N);
		break;
	case 'S':
		this->swap(dir_array.S);
		break;
	}
	return;
}

void Dice::swap(int *dir)
{
	int tmp[6];
	for (int i = 0; i < 6; i++)
		tmp[dir[i]] = num[i];
	for (int i = 0; i < 6; i++)
		num[i] = tmp[i];
	return;
}

void Dice::show_top()
{
	cout << this->num[0] << endl;
	return;
}

int main()
{
	int a;
	Dice dice;

	for (int i = 0; dice.condition(i); i++)
	{
		dice.roll(i);
	}
	dice.show_top();

	return 0;
}


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
int i,N[7],T,F,R,t;
char S[105];
int main()
{
	for(i=1;i<=6;i++)scanf("%d",N+i);
	gets(S);
	gets(S);
	for(T=1,F=2,R=3,i=0;S[i];i++)
	{
		switch(S[i])
		{
		case 'N':t=T,T=F,F=7-t;break;
		case 'E':t=R,R=T,T=7-t;break;
		case 'S':t=F,F=T,T=7-t;break;
		case 'W':t=T,T=R,R=7-t;break;
		}
	}
	printf("%d\n",N[T]);
	return 0;
}



Compiler output:
main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    7 |         gets(S);
      |         ^~~~
      |         fgets
Language: C

#include <iostream>
#include <vector>
#include <stdio.h>
using namespace std;
const int N=0;
const int E=1;
const int S=2;
const int W=3;
const int Z=4;
int rs[5][4]={{0,1,5,4},{0,3,5,2},{0,4,5,1},{0,2,5,3},{3,1,2,4}};
struct xai{
int ds[6];

void round(int n){
	int t=ds[rs[n][0]];
	for(int i=0;i<3;i++){
		ds[rs[n][i]]=ds[rs[n][i+1]];
	}
	ds[rs[n][3]]=t;
}
void roundZ(){
	int cs[4];
	std::vector<int> vec;
	for(int i=0;i<4;i++){
		vec.push_back(ds[rs[Z][i]]);
	}
	for(int i=0;i<4;i++){
		round(Z);
		std::vector<int> vec2;
		for(int i=0;i<4;i++){
			vec2.push_back(ds[rs[Z][i]]);
		}
		if(vec<vec2)vec=vec2;
	}
	for(int i=0;i<4;i++){
		ds[rs[Z][i]]=vec[i];
	}
}
};

int main() {
// your code goes here
xai e;
for(int i=0;i<6;i++){
	scanf("%d",&e.ds[i]);
}
char com[101];
scanf("%s",com);
for(int i=0;com[i]!='\0';i++){
	if(com[i]=='N')e.round(N);
	if(com[i]=='E')e.round(E);
	if(com[i]=='S')e.round(S);
	if(com[i]=='W')e.round(W);
}
printf("%d\n",e.ds[0]);
return 0;
}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<math.h>


struct dice{
            int n[6];
            };

struct dice dice1;

void e(){
         int buff=0;
         buff=dice1.n[0];
         dice1.n[0]=dice1.n[3];
         dice1.n[3]=dice1.n[5];
         dice1.n[5]=dice1.n[2];
         dice1.n[2]=buff;
         }

void s(){
         int buff=0;
         buff=dice1.n[0];
         dice1.n[0]=dice1.n[4];
         dice1.n[4]=dice1.n[5];
         dice1.n[5]=dice1.n[1];
         dice1.n[1]=buff;
         }

void w(){
         int buff=0;
         buff=dice1.n[0];
         dice1.n[0]=dice1.n[2];
         dice1.n[2]=dice1.n[5];
         dice1.n[5]=dice1.n[3];
         dice1.n[3]=buff;
         }

void n(){
         int buff=0;
         buff=dice1.n[0];
         dice1.n[0]=dice1.n[1];
         dice1.n[1]=dice1.n[5];
         dice1.n[5]=dice1.n[4];
         dice1.n[4]=buff;
         }

int main(){
           int me,i;
           char muki[100];
           
                   for(i=0;i<6;i++){
                           scanf("%d",&me);
                           dice1.n[i]=me;
                                    }
                   scanf("%s",&muki);

                   for(i=0;i<100;i++){
                                      if(muki[i]=='\n')break;
                                      if(muki[i]=='E')e();
                                      if(muki[i]=='S')s();
                                      if(muki[i]=='W')==0)w();
                                      if(muki[i]=='N')==0)n();
                                      }
               printf("%d\n",dice1.n[0]);
                    
               return 0;
              }



Compiler output:
main.c: In function 'main':
main.c:61:55: error: expected expression before '==' token
   61 |                                       if(muki[i]=='W')==0)w();
      |                                                       ^~
main.c:61:58: error: expected statement before ')' token
   61 |                                       if(muki[i]=='W')==0)w();
      |                                                          ^
main.c:62:55: error: expected expression before '==' token
   62 |                                       if(muki[i]=='N')==0)n();
      |                                                       ^~
main.c:62:58: error: expected statement before ')' token
   62 |                                       if(muki[i]=='N')==0)n();
      |                                                          ^
Language: C

// Dice01.cc
// 次の展開図から得られるサイコロを転がすシミュレーションを行うプログラムを作成してください。
// サイコロの各面には図のとおりに 1 から 6 のラベルが割りあてられています。
// 入力としてサイコロの各面のラベルに対応する整数と、転がす命令の列が与えられるので、
// サイコロの上面の整数を出力してください。
// シミュレーションの初期状態は、図のとおりのラベルの位置でサイコロが置かれているものとします。
// 【入力】
// １行目に各面の整数が、図に示すラベルの順番に空白区切りで与えられます。
// ２行目に命令を表す１つの文字列が与えられます。命令はそれぞれ図に示す４方向を表す文字 E、N、S、W を含む文字列です。
// 【出力】
// すべての命令を実行した後のサイコロの上面の数を１行に出力してください。
// 【制約】
// ・0 ≤ 入力されるサイコロの面の数字 ≤100
// ・0 ≤ 命令を表す文字列の長さ ≤100
// 【例】
// 入力１：
// 1 2 4 8 16 32
// SE
// 出力１：
// 8
// 各面に 1, 2, 4, 8, 16, 32 と書かれたサイコロを S の方向に転がした後、E の方向に転がすと、上面の整数が 8 になります。
// 入力２：
// 1 2 4 8 16 32
// EESWN
// 出力２：
// 32
#include<iostream>
#include<string>
using namespace std;

class Dice {
public:
  int Top, Bottom, North, South, East, West;

  Dice( int num[]) {
    Top = num[0];
    Bottom = num[5];
    North = num[4];
    South = num[1];
    East = num[2];
    West = num[3];
  }
    
  void move_n( void) {
    int buf_t, buf_b, buf_n, buf_s;

    buf_t = Top;
    buf_b = Bottom;
    buf_n = North;
    buf_s = South;

    Top = buf_s;
    Bottom = buf_n;
    North = buf_t;
    South = buf_b;
  }

  void move_s( void) {
    int buf_t, buf_b, buf_n, buf_s;

    buf_t = Top;
    buf_b = Bottom;
    buf_n = North;
    buf_s = South;

    Top = buf_n;
    Bottom = buf_s;
    North = buf_b;
    South = buf_t;
  }

  void move_e( void) {
    int buf_t, buf_b, buf_e, buf_w;

    buf_t = Top;
    buf_b = Bottom;
    buf_e = East;
    buf_w = West;

    Top = buf_w;
    Bottom = buf_e;
    East = buf_t;
    West = buf_b;
  }

  void move_w( void) {
    int buf_t, buf_b, buf_e, buf_w;

    buf_t = Top;
    buf_b = Bottom;
    buf_e = East;
    buf_w = West;

    Top = buf_e;
    Bottom = buf_w;
    East = buf_b;
    West = buf_t;
  }

  void print_top( void) {
    cout << Top << endl;
  }
};

int main( void) {
  int num[6];
  string order;

  cin >> num[0] >> num[1] >> num[2] >> num[3] >> num[4] >> num[5];
  cin >> order;

  Dice d1( num);

  for ( int i = 0; i < order.size(); i++) {
    if ( order[i] == 'N') d1.move_n();
    else if ( order[i] == 'S') d1.move_s();
    else if ( order[i] == 'E') d1.move_e();
    else if ( order[i] == 'W') d1.move_w();
  }

  d1.print_top();

  return 0;
}



Compiler output:
main.c:27:9: fatal error: iostream: No such file or directory
   27 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

struct DICE {
int mark1,mark2,mark3,mark4,mark5,mark6;





};

void MoveDice(struct DICE *p,char c);

int main(){

struct DICE p;char compass;
scanf("%d %d %d %d %d %d\n",&p->mark1,&p->mark2,&p->mark3,&p->mark4,&p->mark5,&p->mark6);
scanf("%c", &compass);
while(compass!='\n'){
MoveDice(&p,compass);
scanf("%c", &compass);
}

return 0;
}

void MoveDice(struct DICE *p,char c){
int tmp;
tmp=p->mark1;
switch(c){
case 'W':
p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
break;
case 'E':
p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
break;
case 'N':
p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
break;
case 'S':
p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
break;
}
}

Compiler output:
main.c: In function 'main':
main.c:17:31: error: invalid type argument of '->' (have 'struct DICE')
   17 | scanf("%d %d %d %d %d %d\n",&p->mark1,&p->mark2,&p->mark3,&p->mark4,&p->mark5,&p->mark6);
      |                               ^~
main.c:17:41: error: invalid type argument of '->' (have 'struct DICE')
   17 | scanf("%d %d %d %d %d %d\n",&p->mark1,&p->mark2,&p->mark3,&p->mark4,&p->mark5,&p->mark6);
      |                                         ^~
main.c:17:51: error: invalid type argument of '->' (have 'struct DICE')
   17 | scanf("%d %d %d %d %d %d\n",&p->mark1,&p->mark2,&p->mark3,&p->mark4,&p->mark5,&p->mark6);
      |                                                   ^~
main.c:17:61: error: invalid type argument of '->' (have 'struct DICE')
   17 | scanf("%d %d %d %d %d %d\n",&p->mark1,&p->mark2,&p->mark3,&p->mark4,&p->mark5,&p->mark6);
      |                                                             ^~
main.c:17:71: error: invalid type argument of '->' (have 'struct DICE')
   17 | scanf("%d %d %d %d %d %d\n",&p->mark1,&p->mark2,&p->mark3,&p->mark4,&p->mark5,&p->mark6);
      |                                                                       ^~
main.c:17:81: error: invalid type argument of '->' (have 'struct DICE')
   17 | scanf("%d %d %d %d %d %d\n",&p->mark1,&p->mark2,&p->mark3,&p->mark4,&p->mark5,&p->mark6);
      |                                                                                 ^~
Language: C

#include <stdio.h>

struct DICE {
int mark1,mark2,mark3,mark4,mark5,mark6;
};

void MoveDice(struct DICE *p,char c);

int main(){

struct DICE p;char compass;
scanf("%d %d %d %d %d %d\n",&p->mark1,&p->mark2,&p->mark3,&p->mark4,&p->mark5,&p->mark6);
scanf("%c", &compass);
while(compass!='\n'){
MoveDice(&p,compass);
scanf("%c", &compass);
}
printf("%d\n",p.mark1);
return 0;
}

void MoveDice(struct DICE *p,char c){
int tmp;
tmp=p->mark1;
switch(c){
case 'W':
p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
break;
case 'E':
p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
break;
case 'N':
p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
break;
case 'S':
p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
break;
}
}

Compiler output:
main.c: In function 'main':
main.c:12:31: error: invalid type argument of '->' (have 'struct DICE')
   12 | scanf("%d %d %d %d %d %d\n",&p->mark1,&p->mark2,&p->mark3,&p->mark4,&p->mark5,&p->mark6);
      |                               ^~
main.c:12:41: error: invalid type argument of '->' (have 'struct DICE')
   12 | scanf("%d %d %d %d %d %d\n",&p->mark1,&p->mark2,&p->mark3,&p->mark4,&p->mark5,&p->mark6);
      |                                         ^~
main.c:12:51: error: invalid type argument of '->' (have 'struct DICE')
   12 | scanf("%d %d %d %d %d %d\n",&p->mark1,&p->mark2,&p->mark3,&p->mark4,&p->mark5,&p->mark6);
      |                                                   ^~
main.c:12:61: error: invalid type argument of '->' (have 'struct DICE')
   12 | scanf("%d %d %d %d %d %d\n",&p->mark1,&p->mark2,&p->mark3,&p->mark4,&p->mark5,&p->mark6);
      |                                                             ^~
main.c:12:71: error: invalid type argument of '->' (have 'struct DICE')
   12 | scanf("%d %d %d %d %d %d\n",&p->mark1,&p->mark2,&p->mark3,&p->mark4,&p->mark5,&p->mark6);
      |                                                                       ^~
main.c:12:81: error: invalid type argument of '->' (have 'struct DICE')
   12 | scanf("%d %d %d %d %d %d\n",&p->mark1,&p->mark2,&p->mark3,&p->mark4,&p->mark5,&p->mark6);
      |                                                                                 ^~
Language: C

#include <stdio.h>

struct DICE {
int mark1,mark2,mark3,mark4,mark5,mark6;
};

void MoveDice(struct DICE *p,char c);

int main(){

struct DICE p;char compass;
scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
scanf("%c", &compass);
while(compass!='\n'){
MoveDice(&p,compass);
scanf("%c", &compass);
}
printf("%d\n",p.mark1);
return 0;
}

void MoveDice(struct DICE *p,char c){
int tmp;
tmp=p->mark1;
switch(c){
case 'W':
p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
break;
case 'E':
p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
break;
case 'N':
p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
break;
case 'S':
p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
break;
}
}

Compiler output:
main.c: In function 'main':
main.c:12:30: error: invalid type argument of '->' (have 'struct DICE')
   12 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      |                              ^~
main.c:12:39: error: invalid type argument of '->' (have 'struct DICE')
   12 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      |                                       ^~
main.c:12:48: error: invalid type argument of '->' (have 'struct DICE')
   12 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      |                                                ^~
main.c:12:57: error: invalid type argument of '->' (have 'struct DICE')
   12 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      |                                                         ^~
main.c:12:66: error: invalid type argument of '->' (have 'struct DICE')
   12 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      |                                                                  ^~
main.c:12:75: error: invalid type argument of '->' (have 'struct DICE')
   12 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      |                                                                           ^~
Language: C

#include <stdio.h>

struct DICE {
int mark1,mark2,mark3,mark4,mark5,mark6;
};

void MoveDice(struct DICE *p,char c);

int main(){

struct DICE *p;char compass;
scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
scanf("%c", &compass);
while(compass!='\n'){
MoveDice(&p,compass);
scanf("%c", &compass);
}
printf("%d\n",p.mark1);
return 0;
}

void MoveDice(struct DICE *p,char c){
int tmp;
tmp=p->mark1;
switch(c){
case 'W':
p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
break;
case 'E':
p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
break;
case 'N':
p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
break;
case 'S':
p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
break;
}
}

Compiler output:
main.c: In function 'main':
main.c:15:10: error: passing argument 1 of 'MoveDice' from incompatible pointer type [-Wincompatible-pointer-types]
   15 | MoveDice(&p,compass);
      |          ^~
      |          |
      |          struct DICE **
main.c:7:28: note: expected 'struct DICE *' but argument is of type 'struct DICE **'
    7 | void MoveDice(struct DICE *p,char c);
      |               ~~~~~~~~~~~~~^
main.c:18:16: error: 'p' is a pointer; did you mean to use '->'?
   18 | printf("%d\n",p.mark1);
      |                ^
      |                ->
Language: C

#include <stdio.h>

struct DICE {
int mark1,mark2,mark3,mark4,mark5,mark6;
};

void MoveDice(struct DICE *p,char c);

int main(){
struct DICE p;char compass;struct DICE *pp;
pp=*p
scanf("%d %d %d %d %d %d\n",pp->mark1,pp->mark2,pp->mark3,pp->mark4,pp->mark5,pp->mark6);
scanf("%c", &compass);
while(compass!='\n'){
MoveDice(pp,compass);
scanf("%c", &compass);
}
printf("%d\n",pp->mark1);
return 0;
}

void MoveDice(struct DICE *p,char c){
int tmp;
tmp=p->mark1;
switch(c){
case 'W':
p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
break;
case 'E':
p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
break;
case 'N':
p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
break;
case 'S':
p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
break;
}
}

Compiler output:
main.c: In function 'main':
main.c:11:4: error: invalid type argument of unary '*' (have 'struct DICE')
   11 | pp=*p
      |    ^~
main.c:11:6: error: expected ';' before 'scanf'
   11 | pp=*p
      |      ^
      |      ;
   12 | scanf("%d %d %d %d %d %d\n",pp->mark1,pp->mark2,pp->mark3,pp->mark4,pp->mark5,pp->mark6);
      | ~~~~~
Language: C

#include <stdio.h>

struct DICE {
int mark1,mark2,mark3,mark4,mark5,mark6;
};

void MoveDice(struct DICE *p,char c);

int main(){
struct DICE p;char compass;struct DICE *pp;
pp=*p;
scanf("%d %d %d %d %d %d\n",pp->mark1,pp->mark2,pp->mark3,pp->mark4,pp->mark5,pp->mark6);
scanf("%c", &compass);
while(compass!='\n'){
MoveDice(pp,compass);
scanf("%c", &compass);
}
printf("%d\n",pp->mark1);
return 0;
}

void MoveDice(struct DICE *p,char c){
int tmp;
tmp=p->mark1;
switch(c){
case 'W':
p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
break;
case 'E':
p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
break;
case 'N':
p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
break;
case 'S':
p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
break;
}
}

Compiler output:
main.c: In function 'main':
main.c:11:4: error: invalid type argument of unary '*' (have 'struct DICE')
   11 | pp=*p;
      |    ^~
Language: C

#include <stdio.h>

struct DICE {
int mark1,mark2,mark3,mark4,mark5,mark6;
};

void MoveDice(struct DICE *p,char c);

int main(){
struct DICE p;char compass;struct DICE *pp;
pp=p;
scanf("%d %d %d %d %d %d\n",pp->mark1,pp->mark2,pp->mark3,pp->mark4,pp->mark5,pp->mark6);
scanf("%c", &compass);
while(compass!='\n'){
MoveDice(pp,compass);
scanf("%c", &compass);
}
printf("%d\n",pp->mark1);
return 0;
}

void MoveDice(struct DICE *p,char c){
int tmp;
tmp=p->mark1;
switch(c){
case 'W':
p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
break;
case 'E':
p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
break;
case 'N':
p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
break;
case 'S':
p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
break;
}
}

Compiler output:
main.c: In function 'main':
main.c:11:4: error: incompatible types when assigning to type 'struct DICE *' from type 'struct DICE'
   11 | pp=p;
      |    ^
Language: C

#include <stdio.h>

struct DICE {
int mark1,mark2,mark3,mark4,mark5,mark6;
};

void MoveDice(struct DICE *p,char c);

int main(){
struct DICE p;char compass;struct DICE *pp;
pp=*p;
scanf("%d %d %d %d %d %d\n",pp->mark1,pp->mark2,pp->mark3,pp->mark4,pp->mark5,pp->mark6);
scanf("%c", &compass);
while(compass!='\n'){
MoveDice(&p,compass);
scanf("%c", &compass);
}
printf("%d\n",pp->mark1);
return 0;
}

void MoveDice(struct DICE *p,char c){
int tmp;
tmp=p->mark1;
switch(c){
case 'W':
p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
break;
case 'E':
p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
break;
case 'N':
p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
break;
case 'S':
p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
break;
}
}

Compiler output:
main.c: In function 'main':
main.c:11:4: error: invalid type argument of unary '*' (have 'struct DICE')
   11 | pp=*p;
      |    ^~
Language: C

#include <stdio.h>

struct DICE {
int mark1,mark2,mark3,mark4,mark5,mark6;
};

void MoveDice(struct DICE *p,char c);

int main(){
struct DICE p;char compass;struct DICE *pp;
pp=*p;
scanf("%d %d %d %d %d %d\n",pp->mark1,pp->mark2,pp->mark3,pp->mark4,pp->mark5,pp->mark6);
scanf("%c", &compass);
while(compass!='\n'){
MoveDice(&p,compass);
scanf("%c", &compass);
}
printf("%d\n",p.mark1);
return 0;
}

void MoveDice(struct DICE *p,char c){
int tmp;
tmp=p->mark1;
switch(c){
case 'W':
p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
break;
case 'E':
p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
break;
case 'N':
p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
break;
case 'S':
p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
break;
}
}

Compiler output:
main.c: In function 'main':
main.c:11:4: error: invalid type argument of unary '*' (have 'struct DICE')
   11 | pp=*p;
      |    ^~
Language: C

#include <stdio.h>

struct DICE {
int mark1,mark2,mark3,mark4,mark5,mark6;
};

void MoveDice(struct DICE *p,char c);

int main(){
struct DICE p;char compass;struct DICE *pp;
pp=&p;
scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
scanf("%c", &compass);
while(compass!='\n'){
MoveDice(&p,compass);
scanf("%c", &compass);
}
printf("%d\n",p.mark1);
return 0;
}

void MoveDice(struct DICE *p,char c){
int tmp;
tmp=p->mark1;
switch(c){
case 'W':
p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
break;
case 'E':
p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
break;
case 'N':
p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
break;
case 'S':
p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
break;
}
}

Compiler output:
main.c: In function 'main':
main.c:12:30: error: invalid type argument of '->' (have 'struct DICE')
   12 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      |                              ^~
main.c:12:39: error: invalid type argument of '->' (have 'struct DICE')
   12 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      |                                       ^~
main.c:12:48: error: invalid type argument of '->' (have 'struct DICE')
   12 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      |                                                ^~
main.c:12:57: error: invalid type argument of '->' (have 'struct DICE')
   12 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      |                                                         ^~
main.c:12:66: error: invalid type argument of '->' (have 'struct DICE')
   12 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      |                                                                  ^~
main.c:12:75: error: invalid type argument of '->' (have 'struct DICE')
   12 | scanf("%d %d %d %d %d %d\n",p->mark1,p->mark2,p->mark3,p->mark4,p->mark5,p->mark6);
      |                                                                           ^~
Language: C

#include <stdio.h>

struct DICE {
int mark1,mark2,mark3,mark4,mark5,mark6;
};

void MoveDice(struct DICE *p,char c);

int main(){
struct DICE p;char compass;struct DICE *pp;
scanf("%d %d %d %d %d %d\n",*p->mark1,*p->mark2,*p->mark3,*p->mark4,*p->mark5,*p->mark6);
scanf("%c", &compass);
while(compass!='\n'){
MoveDice(&p,compass);
scanf("%c", &compass);
}
printf("%d\n",p.mark1);
return 0;
}

void MoveDice(struct DICE *p,char c){
int tmp;
tmp=p->mark1;
switch(c){
case 'W':
p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
break;
case 'E':
p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
break;
case 'N':
p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
break;
case 'S':
p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
break;
}
}

Compiler output:
main.c: In function 'main':
main.c:11:31: error: invalid type argument of '->' (have 'struct DICE')
   11 | scanf("%d %d %d %d %d %d\n",*p->mark1,*p->mark2,*p->mark3,*p->mark4,*p->mark5,*p->mark6);
      |                               ^~
main.c:11:41: error: invalid type argument of '->' (have 'struct DICE')
   11 | scanf("%d %d %d %d %d %d\n",*p->mark1,*p->mark2,*p->mark3,*p->mark4,*p->mark5,*p->mark6);
      |                                         ^~
main.c:11:51: error: invalid type argument of '->' (have 'struct DICE')
   11 | scanf("%d %d %d %d %d %d\n",*p->mark1,*p->mark2,*p->mark3,*p->mark4,*p->mark5,*p->mark6);
      |                                                   ^~
main.c:11:61: error: invalid type argument of '->' (have 'struct DICE')
   11 | scanf("%d %d %d %d %d %d\n",*p->mark1,*p->mark2,*p->mark3,*p->mark4,*p->mark5,*p->mark6);
      |                                                             ^~
main.c:11:71: error: invalid type argument of '->' (have 'struct DICE')
   11 | scanf("%d %d %d %d %d %d\n",*p->mark1,*p->mark2,*p->mark3,*p->mark4,*p->mark5,*p->mark6);
      |                                                                       ^~
main.c:11:81: error: invalid type argument of '->' (have 'struct DICE')
   11 | scanf("%d %d %d %d %d %d\n",*p->mark1,*p->mark2,*p->mark3,*p->mark4,*p->mark5,*p->mark6);
      |                                                                                 ^~
Language: C

#include <stdio.h>

struct DICE {
int mark1,mark2,mark3,mark4,mark5,mark6;
};

void MoveDice(struct DICE *p,char c);

int main(){
struct DICE p;char compass;struct DICE *pp;
scanf("%d %d %d %d %d %d\n",(*p)->mark1,(*p)->mark2,(*p)->mark3,(*p)->mark4,(*p)->mark5,(*p)->mark6);
scanf("%c", &compass);
while(compass!='\n'){
MoveDice(&p,compass);
scanf("%c", &compass);
}
printf("%d\n",p.mark1);
return 0;
}

void MoveDice(struct DICE *p,char c){
int tmp;
tmp=p->mark1;
switch(c){
case 'W':
p->mark1=p->mark3;p->mark3=p->mark6;p->mark6=p->mark4;p->mark4=tmp;
break;
case 'E':
p->mark1=p->mark4;p->mark4=p->mark6;p->mark6=p->mark3;p->mark3=tmp;
break;
case 'N':
p->mark1=p->mark2;p->mark2=p->mark6;p->mark6=p->mark5;p->mark5=tmp;
break;
case 'S':
p->mark1=p->mark5;p->mark5=p->mark6;p->mark6=p->mark2;p->mark2=tmp;
break;
}
}

Compiler output:
main.c: In function 'main':
main.c:11:30: error: invalid type argument of unary '*' (have 'struct DICE')
   11 | scanf("%d %d %d %d %d %d\n",(*p)->mark1,(*p)->mark2,(*p)->mark3,(*p)->mark4,(*p)->mark5,(*p)->mark6);
      |                              ^~
main.c:11:42: error: invalid type argument of unary '*' (have 'struct DICE')
   11 | scanf("%d %d %d %d %d %d\n",(*p)->mark1,(*p)->mark2,(*p)->mark3,(*p)->mark4,(*p)->mark5,(*p)->mark6);
      |                                          ^~
main.c:11:54: error: invalid type argument of unary '*' (have 'struct DICE')
   11 | scanf("%d %d %d %d %d %d\n",(*p)->mark1,(*p)->mark2,(*p)->mark3,(*p)->mark4,(*p)->mark5,(*p)->mark6);
      |                                                      ^~
main.c:11:66: error: invalid type argument of unary '*' (have 'struct DICE')
   11 | scanf("%d %d %d %d %d %d\n",(*p)->mark1,(*p)->mark2,(*p)->mark3,(*p)->mark4,(*p)->mark5,(*p)->mark6);
      |                                                                  ^~
main.c:11:78: error: invalid type argument of unary '*' (have 'struct DICE')
   11 | scanf("%d %d %d %d %d %d\n",(*p)->mark1,(*p)->mark2,(*p)->mark3,(*p)->mark4,(*p)->mark5,(*p)->mark6);
      |                                                                              ^~
main.c:11:90: error: invalid type argument of unary '*' (have 'struct DICE')
   11 | scanf("%d %d %d %d %d %d\n",(*p)->mark1,(*p)->mark2,(*p)->mark3,(*p)->mark4,(*p)->mark5,(*p)->mark6);
      |                                                                                          ^~