Submission #523752


Source Code Expand

Copy
#include<stdio.h>
#include<string.h>
main(){
  char s[100];
  int i;
  for(i=0;i<100;i++){
    if(s[i]=="L"){
      printf("< ",s[i]);
    }else{
      if(s[i]=="R"){
        printf("> ",s[i]);
      }else{
        if(s[i]=="A"){
          printf("A ",s[i]);
        }
      }
    }
  }
  printf("\n");
  return 0;
}

Submission Info

Submission Time
Task A - スペース高橋君
User ky33
Language C++ (GCC 4.9.2)
Score 0
Code Size 336 Byte
Status

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:7:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
     if(s[i]=="L"){
              ^
./Main.cpp:8:23: warning: too many arguments for format [-Wformat-extra-args]
       printf("< ",s[i]);
                       ^
./Main.cpp:10:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
       if(s[i]=="R"){
                ^
./Main.cpp:11:25: warning: too many arguments for format [-Wformat-extra-args]
         printf("> ",s[i]);
                         ^
./Main.cpp:13:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
         if(s[i]=="A"){
                  ^
./Main.cpp:14:27: warning: too many arguments for format [-Wformat-extra-args]
           printf("A ",s[i]);
                           ^