Submission #855419


Source Code Expand

Copy
#include<stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{

        int n;
        int k;
        int x;
        int y;
        int sum;
        int i;


	// 個数のの入力
        sum = 0;
        scanf("%d %d %d %d",&n,&k,&x,&y);

        for (i = 0,i < n, i;;) {
          if (i < k ) {
           sum = sum + x;
          }
          else
           sum = sum + y;
          }  
        } 

        
	return 0;
}

Submission Info

Submission Time
Task A - 高橋君とホテルイージー / Tak and Hotels (ABC Edit)
User hirotarou
Language C (GCC 5.4.1)
Score 0
Code Size 461 Byte
Status

Compile Error

./Main.c:29:2: error: expected identifier or ‘(’ before ‘return’
  return 0;
  ^
./Main.c:30:1: error: expected identifier or ‘(’ before ‘}’ token
 }
 ^
./Main.c: In function ‘main’:
./Main.c:17:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d %d %d",&n,&k,&x,&y);
         ^