AtCoder Beginner Contest 001

Submission #288505

Source codeソースコード

#include <stdio.h>
#include <string>
#include <math.h>
int main(){
  int Deg,Dis;
  double wind = 0.0;
  int w = 100;
  int cnt = 0,i = 0;
  double v = 0.0;
  
  const int RANK = 17;
  const std::string rank[RANK] = {"N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW","c"};
  
  const int Rank = 13;
  const double border[Rank] = {0.0,0.3,1.6,3.4,5.5,8.0,10.8,13.9,17.2,20.8,24.5,28.5,32.7};
  
  scanf("%d",&Deg);
  scanf("%d",&Dis);
  
  double huukou = (double)Deg / 10;
  wind = round((double)Dis / 6)/10;

  
  for(int i = 0;i < Rank-1; i++){
    v = wind;
    if(v >= border[i] && v < border[i+1]){
      w = i;
     
     
    }
      
  }
  if(w == 100){
    w = 12;
  }
  for(double k = 11.25;k < 348.75; k = k+22.5){
   
    i++;
      if(huukou >= k && huukou < k + 22.5){
        cnt = i;
       break;
        }
      if(huukou <11.25 || huukou >=348.75){
        
        break;
        printf("%s",rank[0].c_str());  
      }
    
    }
  

  
  if(v >= border[0] && v <border[1]){
    cnt = 16;
   }



  
    printf("%s\n",rank[cnt].c_str());
    printf("%d\n",w);
  
  return 0;
}

Submission

Task問題 C - 風力観測
User nameユーザ名 assary
Created time投稿日時
Language言語 C++ (G++ 4.6.4)
Status状態 CE
Score得点 -
Source lengthソースコード長 1214 Byte
File nameファイル名
Exec time実行時間 -
Memory usageメモリ使用量 -

Compiler messageコンパイルメッセージ

./Main.cpp:53:1: error: stray ‘\343’ in program
./Main.cpp:53:1: error: stray ‘\200’ in program
./Main.cpp:53:1: error: stray ‘\200’ in program
./Main.cpp:53:1: error: stray ‘\343’ in program
./Main.cpp:53:1: error: stray ‘\200’ in program
./Main.cpp:53:1: error: stray ‘\200’ in program
./Main.cpp:54:3: error: stray ‘\343’ in program
./Main.cpp:54:3: error: stray ‘\200’ in program
./Main.cpp:54:3: error: stray ‘\200’ in program
./Main.cpp:54:3: error: stray ‘\343’ in program
./Main.cpp:54:3: error: stray ‘\200’ in program
./Main.cpp:54:3: error: stray ‘\200’ in program
./Main.cpp:55:1: error: stray ‘\343’ in program
./Main.cpp:55:1: error: stray ‘\200’ in program
./Main.cpp:55:1: error: stray ‘\200’ in program
./Main.cpp:55:1: error: stray ‘\343’ in program
./Main.cpp:55:1: error: stray ‘\200’ in program
./Main.cpp:55:1: error: stray ‘\200’ in program
./Main.cpp:63:1: error: stray ‘\343’ in program
./Main.cpp:63:1: error: stray ‘\20...

Test case