submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s267183940 | p00444 | C | #include <stdio.h>
int main()
{
int n, cnt=0;
while (1) {
scanf("%d", &n);
if (n == 0)break;
do { n -= 500;cnt += 1; } while (n > 499);
do { n -= 100;cnt += 1; } while (n > 99);
do { n -= 10;cnt += 1; } while (n > 0);
printf("%d", cnt);
return 0;
} | main.c: In function 'main':
main.c:18:9: error: expected declaration or statement at end of input
18 | }
| ^
|
s545460083 | p00444 | C | #include <stdio.h>
int main()
{
int n, cnt=0;
while (1) {
scanf("%d", &n);
if (n == 0)break;
do { n -= 500;cnt += 1; } while (n > 499);
if(n!=0)
do { n -= 100;cnt += 1; } while (n > 99);
if(n!=0)
do { n -= 10;cnt += 1; } while (n > 0);
printf("%d", cnt);
return 0;
} | main.c: In function 'main':
main.c:20:9: error: expected declaration or statement at end of input
20 | }
| ^
|
s591843086 | p00444 | C | #include <stdio.h>
int main()
{
int n, cnt=0;
while (1) {
scanf("%d", &n);
if (n == 0)break;
while (n > 499) {
n -= 500;
cnt++;
}
while (n > 99) {
n -= 100;
cnt++;
}
while (n > 49) {
n -= 50;
cnt++;
}
while (n > 9) {
n -= 10;
cnt++;
}
while (n > 4) {
n -= 5;
cnt++;
}
while (n > 0) {
n -= 1;
cnt++;
}
printf("%d", cnt);
return 0;
} | main.c: In function 'main':
main.c:37:9: error: expected declaration or statement at end of input
37 | }
| ^
|
s941113872 | p00444 | C | #include <stdio.h>
int main()
{
int n, cnt=0;
while (1) {
scanf("%d", &n);
if (n == 0)break;
n = 1000 - n;
while (n > 499) {
n -= 500;
cnt++;
}
while (n > 99) {
n -= 100;
cnt++;
}
while (n > 49) {
n -= 50;
cnt++;
}
while (n > 9) {
n -= 10;
cnt++;
}
while (n > 4) {
n -= 5;
cnt++;
}
while (n > 0) {
n -= 1;
cnt++;
}
printf("%d", cnt);
return 0;
} | main.c: In function 'main':
main.c:39:9: error: expected declaration or statement at end of input
39 | }
| ^
|
s025851431 | p00444 | C | #include <stdio.h>
int main()
{
int n, cnt=0,a;
while (1) {
scanf("%d", &a);
if (a == 0)break;
n = 1000 - a;
while (n > 499) {
n -= 500;
cnt+=1;
}
while (n > 99) {
n -= 100;
cnt+=1;
}
while (n > 49) {
n -= 50;
cnt+=1;
}
while (n > 9) {
n -= 10;
cnt+=1;
}
while (n > 4) {
n -= 5;
cnt+=1;
}
while (n > 0) {
n -= 1;
cnt+=1;
}
printf("%d", cnt);
return 0;
} | main.c: In function 'main':
main.c:39:9: error: expected declaration or statement at end of input
39 | }
| ^
|
s012999904 | p00444 | C | #include <stdio.h>
int main()
{
int n, cnt=0,a;
while (1) {
scanf("%d", &a);
if (a == 0)break;
n = 1000 - a;
while (n > 499) {
n -= 500;
cnt+=1;
}
while (n > 99) {
n -= 100;
cnt+=1;
}
while (n > 49) {
n -= 50;
cnt+=1;
}
while (n > 9) {
n -= 10;
cnt+=1;
}
while (n > 4) {
n -= 5;
cnt+=1;
}
while (n > 0) {
n -= 1;
cnt+=1;
}
printf("%d\n", cnt);
return 0;
} | main.c: In function 'main':
main.c:39:9: error: expected declaration or statement at end of input
39 | }
| ^
|
s204384117 | p00444 | C | include<stdio.h>
int main(void){
int change;
int buy;
int count;
while(1){
scanf("%d",&buy);
if(buy==0) break;
change=1000-buy;
count=0;
// printf("now_change: %d\n",change);
while(change>=500){
change-=500;
count++;
// printf("now_change: %d\n",change);
}
while(change>=100){
change-=100;
count++;
// printf("now_change: %d\n",change);
}
while(change>=50){
change-=50;
count++;
// printf("now_change: %d\n",change);
}
while(change>=10){
change-=10;
count++;
// printf("now_change: %d\n",change);
}
while(change>=5){
change-=5;
count++;
// printf("now_change: %d\n",change);
}
while(change>0){
change-=1;
count++;
// printf("now_change: %d\n",change);
}
printf("%d\n",count);
}
return 0;
}
| main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
|
s581397410 | p00444 | C | #include <stdio.h>
main(){
int kingaku,kouka,k500,k100,k50,k10,k5;
kouka=0;
scanf("%d",&kingaku);
kingaku/500=k500;
kouka+=k500;
kingaku-=k500;
kingaku/100=k100;
kouka+=k100;
kingaku-=k100;
kingaku/50=k50;
kouka+=k50;
kingaku-=k50;
kingaku/10=k10;
kouka+=k10;
kingaku-=k10;
kingaku/5=k5;
kouka+=k5;
kingaku-=k5;
kouka+=kingaku;
printf("%d",kouka);
return 0;
} | main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(){
| ^~~~
main.c: In function 'main':
main.c:6:15: error: lvalue required as left operand of assignment
6 | kingaku/500=k500;
| ^
main.c:9:15: error: lvalue required as left operand of assignment
9 | kingaku/100=k100;
| ^
main.c:12:14: error: lvalue required as left operand of assignment
12 | kingaku/50=k50;
| ^
main.c:15:14: error: lvalue required as left operand of assignment
15 | kingaku/10=k10;
| ^
main.c:18:13: error: lvalue required as left operand of assignment
18 | kingaku/5=k5;
| ^
|
s607959526 | p00444 | C | #include <stdio.h>
main(){
int kingaku,kouka,k500,k100,k50,k10,k5;
kouka=0;
scanf("%d",&kingaku);
kingaku/500=k500;
kouka+=k500;
kingaku-=k500;
kingaku/100=k100;
kouka+=k100;
kingaku-=k100;
kingaku/50=k50;
kouka+=k50;
kingaku-=k50;
kingaku/10=k10;
kouka+=k10;
kingaku-=k10;
kingaku/5=k5;
kouka+=k5;
kingaku-=k5;
kouka+=kingaku;
printf("%d\n",kouka);
return 0;
} | main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(){
| ^~~~
main.c: In function 'main':
main.c:6:15: error: lvalue required as left operand of assignment
6 | kingaku/500=k500;
| ^
main.c:9:15: error: lvalue required as left operand of assignment
9 | kingaku/100=k100;
| ^
main.c:12:14: error: lvalue required as left operand of assignment
12 | kingaku/50=k50;
| ^
main.c:15:14: error: lvalue required as left operand of assignment
15 | kingaku/10=k10;
| ^
main.c:18:13: error: lvalue required as left operand of assignment
18 | kingaku/5=k5;
| ^
|
s457614475 | p00444 | C |
include <stdio.h>
main(){
int kingaku,kouka,k500,k100,k50,k10,k5;
kouka=0 ;
scanf("%d",&kingaku);
if(kingaku<0||kingaku>1000) input("error")
else{
kingaku=1000-kingaku;
k500=kingaku/500;
kouka+=k500;
kingaku-=k500*500;
k100=kingaku/100;
kouka+=k100;
kingaku-=k100*100;
k50=kingaku/50;
kouka+=k50;
kingaku-=k50*50;
k10=kingaku/10;
kouka+=k10;
kingaku-=k10*10;
k5=kingaku/5;
kouka+=k5;
kingaku-=k5*5;
kouka+=kingaku;
printf("%d\n",kouka);}
return 0;
} | main.c:2:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
2 | include <stdio.h>
| ^
|
s999812852 | p00444 | C | #include <stdio.h>
main(){
int kingaku,kouka;
kouka=0 ;
while(1){
scanf("%d",&kingaku);
if(kingaku==0) break;
kingaku=1000-kingaku;
k500=kingaku/500;
kouka+=k500;
kingaku-=k500*500;
k100=kingaku/100;
kouka+=k100;
kingaku-=k100*100;
k50=kingaku/50;
kouka+=k50;
kingaku-=k50*50;
k10=kingaku/10;
kouka+=k10;
kingaku-=k10*10;
k5=kingaku/5;
kouka+=k5;
kingaku-=k5*5;
kouka+=kingaku;
}
printf("%d\n",kouka);
return 0;
} | main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(){
| ^~~~
main.c: In function 'main':
main.c:12:4: error: 'k500' undeclared (first use in this function)
12 | k500=kingaku/500;
| ^~~~
main.c:12:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:4: error: 'k100' undeclared (first use in this function)
16 | k100=kingaku/100;
| ^~~~
main.c:20:4: error: 'k50' undeclared (first use in this function)
20 | k50=kingaku/50;
| ^~~
main.c:24:4: error: 'k10' undeclared (first use in this function)
24 | k10=kingaku/10;
| ^~~
main.c:28:4: error: 'k5' undeclared (first use in this function)
28 | k5=kingaku/5;
| ^~
|
s930096451 | p00444 | C | #include <stdio.h>
main(){
int kingaku,kouka;
kouka=0 ;
while(1){
scanf("%d",&kingaku);
if(kingaku==0) break;
else{
kingaku=1000-kingaku;
k500=kingaku/500;
kouka+=k500;
kingaku-=k500*500;
k100=kingaku/100;
kouka+=k100;
kingaku-=k100*100;
k50=kingaku/50;
kouka+=k50;
kingaku-=k50*50;
k10=kingaku/10;
kouka+=k10;
kingaku-=k10*10;
k5=kingaku/5;
kouka+=k5;
kingaku-=k5*5;
kouka+=kingaku;}
}
printf("%d\n",kouka);
return 0;
} | main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(){
| ^~~~
main.c: In function 'main':
main.c:12:4: error: 'k500' undeclared (first use in this function)
12 | k500=kingaku/500;
| ^~~~
main.c:12:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:4: error: 'k100' undeclared (first use in this function)
16 | k100=kingaku/100;
| ^~~~
main.c:20:4: error: 'k50' undeclared (first use in this function)
20 | k50=kingaku/50;
| ^~~
main.c:24:4: error: 'k10' undeclared (first use in this function)
24 | k10=kingaku/10;
| ^~~
main.c:28:4: error: 'k5' undeclared (first use in this function)
28 | k5=kingaku/5;
| ^~
|
s542632326 | p00444 | C | #include <stdio.h>
main(){
int kingaku,kouka;
kouka=0 ;
while(1){
scanf("%d",&kingaku);
if(kingaku==0) break;
else{
kingaku=1000-kingaku;
k500=kingaku/500;
kouka+=k500;
kingaku-=k500*500;
k100=kingaku/100;
kouka+=k100;
kingaku-=k100*100;
k50=kingaku/50;
kouka+=k50;
kingaku-=k50*50;
k10=kingaku/10;
kouka+=k10;
kingaku-=k10*10;
k5=kingaku/5;
kouka+=k5;
kingaku-=k5*5;
kouka+=kingaku;}
}
printf("%d\n",kouka);
return 0;
} | main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(){
| ^~~~
main.c: In function 'main':
main.c:12:4: error: 'k500' undeclared (first use in this function)
12 | k500=kingaku/500;
| ^~~~
main.c:12:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:4: error: 'k100' undeclared (first use in this function)
16 | k100=kingaku/100;
| ^~~~
main.c:20:4: error: 'k50' undeclared (first use in this function)
20 | k50=kingaku/50;
| ^~~
main.c:24:4: error: 'k10' undeclared (first use in this function)
24 | k10=kingaku/10;
| ^~~
main.c:28:4: error: 'k5' undeclared (first use in this function)
28 | k5=kingaku/5;
| ^~
|
s358624851 | p00444 | C | #include <stdio.h>
main(){
int kingaku,kouka,k500,k100,k50,k10,k5;
while(1){
scanf("%d",&kingaku);
kouka=0
if(kingaku==0) break;
kingaku=1000-kingaku;
k500=kingaku/500;
kouka+=k500;
kingaku-=k500*500;
k100=kingaku/100;
kouka+=k100;
kingaku-=k100*100;
k50=kingaku/50;
kouka+=k50;
kingaku-=k50*50;
k10=kingaku/10;
kouka+=k10;
kingaku-=k10*10;
k5=kingaku/5;
kouka+=k5;
kingaku-=k5*5;
kouka+=kingaku;
printf("%d\n",kouka);
}
return 0;
} | main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(){
| ^~~~
main.c: In function 'main':
main.c:7:10: error: expected ';' before 'if'
7 | kouka=0
| ^
| ;
8 |
9 | if(kingaku==0) break;
| ~~
|
s522298694 | p00444 | C | #include<stdio.h>
int main(){
int i;
int a;
int c;
int coin[] = {500,100,50,10,5,1}
while(1){
scanf("%d ",&a);
if(!a)break;
c = 0;
a = 1000-a;
for(i=0;i<6;i++){
while(a>=coin[i]){
a -= coin[i];
c++;
}
}
printf("%d\n",c);
}
return 0;
} | main.c: In function 'main':
main.c:9:3: error: expected ',' or ';' before 'while'
9 | while(1){
| ^~~~~
|
s864346028 | p00444 | C | void main(){
int n;
int count = 0;
int a[] ={500,100,50,10,5,1};
int i ;
while(true){
scanf("%d",&n);
if(!n){
break
}
count= 0;
for(i = 0; i <6;i++){
while(n>a[i]){
n-=a[i];
count++;
}
}
printf("%d\n",count);
}
} | main.c: In function 'main':
main.c:6:7: error: 'true' undeclared (first use in this function)
6 | while(true){
| ^~~~
main.c:1:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
+++ |+#include <stdbool.h>
1 | void main(){
main.c:6:7: note: each undeclared identifier is reported only once for each function it appears in
6 | while(true){
| ^~~~
main.c:7:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
7 | scanf("%d",&n);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | void main(){
main.c:7:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
7 | scanf("%d",&n);
| ^~~~~
main.c:7:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:9:6: error: expected ';' before '}' token
9 | break
| ^
| ;
10 | }
| ~
main.c:18:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
18 | printf("%d\n",count);
| ^~~~~~
main.c:18:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:18:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:18:1: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s208329138 | p00444 | C | #include<stdio.h>
int main(void){
int money;
int n;
int i;
n = 0;
scanf("%d", &money);
money = 1000 - money;
if (money >= 500){
n += money / 500;
money %= 500;
}
if (money >= 100 && money < 500){
n += money / 100;
money %= 100;
}
if (money >= 50 && money < 100){
n += money / 50;
money %= 50;
}
if (money >= 10 && money < 50){
n += money / 10;
money %= 10;
}
if (money h>= 5 && money < 10){
n += money / 5;
money %= 5;
}
n += money;
printf("%d\n", n);
return 0;
} | main.c: In function 'main':
main.c:30:12: error: expected ')' before 'h'
30 | if (money h>= 5 && money < 10){
| ~ ^~
| )
|
s047556139 | p00444 | C | #include <iostream>
using namespace std;
int main(){
int money;
while(cin >> money && money !=0){
int count =0;
int res = 1000 - money;
for(int i=0;i<3;i++){
// cout << res << endl;
count +=res %10;
if(res % 10 >5) count -= 4;
res /=10;
}
cout << count << endl;
}
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s605951161 | p00444 | C | include <stdio.h>
main() {
int pay, charge, count=0, i;
scanf("%d", &pay);
charge = 1000 - pay;
count += i = charge/500;
charge = charge - i*500;
count += i = charge/100;
charge = charge - i*100;
count += i = charge/50;
charge = charge - i*50;
count += i = charge/10;
charge = charge - i*10;
count += i = charge/5;
charge = charge - i*5;
count += i = charge/1;
charge = charge - i*1;
printf("%d\n", count);
return 0;
} | main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
|
s636856644 | p00444 | C | #include <iostream>
using namespace std;
int main(){
int n ,coin=0;
while ( 1 ){
cin >> n;
if( cin.eof() ){
break;
}
n = 1000 - n;
if( n >= 500 ){
while( n >= 500 ){
n -= 500;
coin++;
}
}
if( n >= 100 ){
while( n >= 100 ){
n -= 100;
coin++;
}
}
if( n >= 50 ){
while( n >= 50 ){
n -= 50;
coin++;
cout << "50" << endl;
}
}
if( n >= 10 ){
while( n >= 10 ){
n -= 10;
coin++;
}
}
if( n >= 5 ){
while( n >= 5 ){
n -= 5;
coin++;
}
}
if( n >= 1 ){
while( n >= 1 ){
n -= 1;
coin++;
}
}
cout << coin << endl;
coin = 0;
}
return 0;
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s037145418 | p00444 | C | #include<stdio.h>
int f(int n){
count=x/n;
x=x%n;
}
int main(){
int x,count;
scanf("%d",&x);
x=1000-x;
f(500);
f(100);
f(50);
f(10);
f(5);
count+=x;
printf("%d",count);
} | main.c: In function 'f':
main.c:3:1: error: 'count' undeclared (first use in this function)
3 | count=x/n;
| ^~~~~
main.c:3:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:3:7: error: 'x' undeclared (first use in this function)
3 | count=x/n;
| ^
|
s473206374 | p00444 | C | #include<stdio.h>
int x,count;
int f(int n){
count=x/n;
x=x%n;
}
int main(){
count=0;
scanf("%d",&x);
x=1000-x;
f(500);
f(100);
f(50);
f(10);
f(5);
count+=x;
printf("%d",count); | main.c: In function 'main':
main.c:17:1: error: expected declaration or statement at end of input
17 | printf("%d",count);
| ^~~~~~
|
s046607392 | p00444 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
while(cin >> n, n){
n = 1000 - n
int ans = n/500+n%500/100+
n%100/50+n%50/10
n%10/5+ n%5
cout << ans << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:21: error: expected ';' before 'int'
7 | n = 1000 - n
| ^
| ;
8 | int ans = n/500+n%500/100+
| ~~~
|
s465365886 | p00444 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
while(cin >> n, n){
n = 1000 - n;
int ans = n/500+n%500/100+
n%100/50+n%50/10
n%10/5+ n%5
cout << ans << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:13: error: expected ',' or ';' before 'n'
10 | n%10/5+ n%5
| ^
|
s082980669 | p00444 | C++ | #include <bits/stdc++.h>
using namespace std;
#define TEMP_T template<typename T>
TEMP_T void sort(T& v){ sort(v.begin(), v.end()); }
TEMP_T void revs(T& v){ reverse(v.begin(), v.end()); }
TEMP_T void uniq(T& v){ sort(v); v.erase(unique(v.begin(), v.end())); }
TEMP_T T cums(T& v){ T r(v.size()); partial_sum(v.begin(), v.end(), r); return r; }
TEMP_T void show(T& v, char delim=' ', char end='\n'){ for(int i=0; i<v.size()-1; i++) cout << v[i] << delim; cout << v[v.size()-1] << end; }
TEMP_T T acum(vector<T>& v, T b=0){ return accumulate(v.begin(), v.end(), b); }
TEMP_T vector<T> inpt(int n){ vector<T> v(n); for (int i=0; i<n; i++) cin >> v[i]; return v; }
static inline int in(){ int x; scanf("%d", &x); return x; }
struct Solver {
Solver(){}
int solve(){
}
};
int main()
{
int n;
while (n = in()){
n = 1000 - n;
int c = 0;
for (int i = 0; i < 6; i++){
static const int c[] = {500, 100, 50, 10, 5, 1};
c += n / c[i];
n %= c[i];
}
printf("%d\n", c);
}
return (0);
} | a.cc: In member function 'int Solver::solve()':
a.cc:19:3: warning: no return statement in function returning non-void [-Wreturn-type]
19 | }
| ^
a.cc: In function 'int main()':
a.cc:30:9: error: assignment of read-only variable 'c'
30 | c += n / c[i];
| ~~^~~~~~~~~~~
|
s739809006 | p00444 | C++ | #include<stdio.h>
int main(void){
int amount,coins+=0;
scanf("%d",&amount);
amount=1000-amount;
coins+=amount/500;
coins+=(amount%500)/100;
coins+=(amount%100)/50;
coins+=(amount%50)/10;
coins+=(amount%10)/5;
coins+=amount%5;
printf("%d\n",coins);
return 0;
} | a.cc: In function 'int main()':
a.cc:3:25: error: expected initializer before '+=' token
3 | int amount,coins+=0;
| ^~
a.cc:6:9: error: 'coins' was not declared in this scope
6 | coins+=amount/500;
| ^~~~~
|
s897174610 | p00444 | C++ | #include <iostream>
using namespace std;
int main(){
int a,b,c,d1,e,f,g,h;
int sum=0;
while(cin>>a){
if(a==0)break;
b=1000-a;
c=b/500;
d=(b-500*c)/100;
e=(b-500*c-100*d)/50;
f=(b-500*c-100*d-50*e)/10;
g=(b-500*c-100*d-50*e-10*f)/5;
h=b-500*c-100*d-50*e-10*f-5*g;
cout<<c+d+e+f+g+h<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:11:17: error: 'd' was not declared in this scope
11 | d=(b-500*c)/100;
| ^
|
s537516336 | p00444 | C++ | #include<iostream>
using namespace std;
int main(){
while(true){
int iwakurasisetudan;
int b;
int c;
cin>>iwakurasisetudan;
if(iwakurasisetudan==0){break;
}else{ c=1000-a;
b=c/500;
c=c%500;
b=b+c/100;
c=c%100;
b=b+c/50;
c=c%50;
b=b+c/10;
c=c%10;
b=b+c/5;
c=c%5;
b=b+c;
cout<<b<<endl;
}}}
| a.cc: In function 'int main()':
a.cc:11:16: error: 'a' was not declared in this scope
11 | }else{ c=1000-a;
| ^
|
s926721768 | p00444 | C++ | #include <stdio.h>
int change(int);
int main(void) {
int money, mai;
scanf("%d", &money);
while(money != 0) {
money = 1000 - money;
mai = change(money);
scanf("%d", &money);
}
printf("%d\n", mai);
return 0;
}
int change (kane){
int count = 0, i = 0;
int wei[6] = {500, 100, 50, 10, 5, 1};
while(kane > 0 && i < 6) {
if((kane / wei[i]) > 0) {
kane = kane - wei[i];
printf("%d, %d\n", kane, i);
count++;
}
i++;
}
return count;
} | a.cc:15:17: error: 'int change' redeclared as different kind of entity
15 | int change (kane){
| ^
a.cc:2:5: note: previous declaration 'int change(int)'
2 | int change(int);
| ^~~~~~
a.cc:15:13: error: 'kane' was not declared in this scope
15 | int change (kane){
| ^~~~
|
s762244199 | p00444 | C++ | main(){
int money = 1000;int buy = 0;int maisuu = 0;
cin >> buy;
money = money - buy
if(money >= 500){
maisuu = maisuu + 1;
money = money - 500 ;
}
if(money >= 100){
maisuu = maisuu + money/100;
money =money % 100;
}
if(money >= 50){
maisuu = maisuu + 1;
money = money - 50 ;
}
if(money >= 100){
maisuu = maisuu + money/10;
money =money % 10;
}
money = money - buy
if(money >= 5){
maisuu = maisuu + 1;
money = money - 5 ;
}
maisuu = maisuu + money;
cout << maisuu << endl;
} | a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:3:1: error: 'cin' was not declared in this scope
3 | cin >> buy;
| ^~~
a.cc:4:20: error: expected ';' before 'if'
4 | money = money - buy
| ^
| ;
5 | if(money >= 500){
| ~~
a.cc:21:20: error: expected ';' before 'if'
21 | money = money - buy
| ^
| ;
22 | if(money >= 5){
| ~~
a.cc:27:1: error: 'cout' was not declared in this scope
27 | cout << maisuu << endl;
| ^~~~
a.cc:27:19: error: 'endl' was not declared in this scope
27 | cout << maisuu << endl;
| ^~~~
|
s003301706 | p00444 | C++ | main(){
int money = 1000;int buy = 0;int maisuu = 0;
cin >> buy;
money = money - buy;
if(money >= 500){
maisuu = maisuu + 1;
money = money - 500 ;
}
if(money >= 100){
maisuu = maisuu + money/100;
money =money % 100;
}
if(money >= 50){
maisuu = maisuu + 1;
money = money - 50 ;
}
if(money >= 100){
maisuu = maisuu + money/10;
money =money % 10;
}
money = money - buy
if(money >= 5){
maisuu = maisuu + 1;
money = money - 5 ;
}
maisuu = maisuu + money;
cout << maisuu << endl;
} | a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:3:1: error: 'cin' was not declared in this scope
3 | cin >> buy;
| ^~~
a.cc:21:20: error: expected ';' before 'if'
21 | money = money - buy
| ^
| ;
22 | if(money >= 5){
| ~~
a.cc:27:1: error: 'cout' was not declared in this scope
27 | cout << maisuu << endl;
| ^~~~
a.cc:27:19: error: 'endl' was not declared in this scope
27 | cout << maisuu << endl;
| ^~~~
|
s254044285 | p00444 | C++ | #include <iostream>
main(){
int money = 1000;int buy = 0;int maisuu = 0;
cin >> buy;
money = money - buy;
if(money >= 500){
maisuu = maisuu + 1;
money = money - 500 ;
}
if(money >= 100){
maisuu = maisuu + money/100;
money =money % 100;
}
if(money >= 50){
maisuu = maisuu + 1;
money = money - 50 ;
}
if(money >= 100){
maisuu = maisuu + money/10;
money =money % 10;
}
money = money - buy
if(money >= 5){
maisuu = maisuu + 1;
money = money - 5 ;
}
maisuu = maisuu + money;
cout << maisuu << endl;
return 0;
} | a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:4:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
4 | cin >> buy;
| ^~~
| 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:22:20: error: expected ';' before 'if'
22 | money = money - buy
| ^
| ;
23 | if(money >= 5){
| ~~
a.cc:28:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
28 | cout << maisuu << 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:28:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
28 | cout << maisuu << 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)
| ^~~~
|
s910618528 | p00444 | C++ | #include <iostream>
using namespace std;
main(){
int money = 1000;int buy = 0;int maisuu = 0;
cin >> buy;
money = money - buy;
if(money >= 500){
maisuu = maisuu + 1;
money = money - 500 ;
}
if(money >= 100){
maisuu = maisuu + money/100;
money =money % 100;
}
if(money >= 50){
maisuu = maisuu + 1;
money = money - 50 ;
}
if(money >= 100){
maisuu = maisuu + money/10;
money =money % 10;
}
money = money - buy
if(money >= 5){
maisuu = maisuu + 1;
money = money - 5 ;
}
maisuu = maisuu + money;
cout << maisuu << endl;
return 0;
} | a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:23:20: error: expected ';' before 'if'
23 | money = money - buy
| ^
| ;
24 | if(money >= 5){
| ~~
|
s797400722 | p00444 | C++ | #include<iostream>
#include<string>
#include<vector>
#define CI cin >>
#define CO cout <<
#define E << endl;
using namespace std;
int main(void) {
int temp = 0;
int cost_input[10];
int cost_return = 0;
int num = 0;
int j = 0;
for (int i = 0; i < 10; ++i) {
CI temp;
if (temp == 0) {
j = i;
break;
}
cost_input[i] = temp;
cost_return = 1000 - cost_input[i];
num = 0;
if (cost_return < 5) {
num = cost_return;
break;
}
else {
if (cost_return < 10) {
num = 1 + cost_return - 5;
}
/*else {
if (cost_return < 100) {
num += (cost_return / 10);
if (cost_return % 10 < 5) {
num += cost_return % 10
}
else {
num += 1 + cost_return - 5;
}
}
else
{
if (cost_return < 500) {
num += (cost_return / 100);
if (cost_return % 100 < 5) {
num += cost_return % 10
}
else {
num += 1 + cost_return - 5;
}
}
}
}*/
}
if (cost_return >= 500) {
++num_answer;
cost_return -= 500;
}
while (1) {
if (cost_return >= 100) {
++num_answer;
cost_return -= 100;
}
if (cost_return < 100)break;
}
if (cost_return >= 50) {
++num_answer;
cost_return -= 50;
}
while (1) {
if (cost_return >= 10) {
++num_answer;
cost_return -= 10;
if (cost_return < 10)break;
}
}
if (cost_return >= 5) {
++num_answer;
cost_return -= 5;
}
while (1) {
if (cost_return >= 1) {
++num_answer;
cost_return -= 1;
}
if (cost_return < 1)break;
}
/*if (cost_return >= 500) {
++num_answer;
cost_return -= 500;
}
while (1) {
if (cost_return >= 100) {
++num_answer;
cost_return -= 100;
}
if (cost_return < 100)break;
}
if (cost_return >= 50) {
++num_answer;
cost_return -= 50;
}
while (1){
if (cost_return >= 10) {
++num_answer;
cost_return -= 10;
if (cost_return < 10)break;
}
}
if (cost_return >= 5) {
++num_answer;
cost_return -= 5;
}
while (1) {
if (cost_return >= 1) {
++num_answer;
cost_return -= 1;
}
if (cost_return < 1)break;
}*/
}
for (int i = 0; i < j;++i) {
CO num_answer E
}
} | a.cc: In function 'int main()':
a.cc:62:27: error: 'num_answer' was not declared in this scope
62 | ++num_answer;
| ^~~~~~~~~~
a.cc:67:35: error: 'num_answer' was not declared in this scope
67 | ++num_answer;
| ^~~~~~~~~~
a.cc:73:27: error: 'num_answer' was not declared in this scope
73 | ++num_answer;
| ^~~~~~~~~~
a.cc:78:35: error: 'num_answer' was not declared in this scope
78 | ++num_answer;
| ^~~~~~~~~~
a.cc:85:27: error: 'num_answer' was not declared in this scope
85 | ++num_answer;
| ^~~~~~~~~~
a.cc:90:35: error: 'num_answer' was not declared in this scope
90 | ++num_answer;
| ^~~~~~~~~~
a.cc:133:20: error: 'num_answer' was not declared in this scope
133 | CO num_answer E
| ^~~~~~~~~~
|
s346780825 | p00444 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
using namespace std;
int main()
{
int a = 0;
int b;
int c = 0;
for (; a != 0;)
{
cin >> a;
b = a;
for (; b != 0;)
{
if (b >= 500)
{
b = b - 500;
c++;
}
if (b >= 100)
{
b = b - 100;
c++;
}
if (b >= 50)
{
b = b - 50;
c++;
}
if (b >= 10)
{
b = b - 10;
c++;
}
if (b >= 5)
{
b = b - 5;
c++;
}
if (b >= 1)
{
b = b - 1;
c++;
}
cout<<c<<endl
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:49:38: error: expected ';' before '}' token
49 | cout<<c<<endl
| ^
| ;
50 | }
| ~
|
s055531449 | p00444 | C++ | #include <iostream>
using namespace std;
int main() {
int all, rem, count = 0, tmp;
while (1) {
cin >> all;
if (all == 0)
break;
rem = 1000 - all;
if (rem >= 500) {
count = count + 1;
rem = rem - 500;
}
if (rem >= 100) {
tmp = rem / 100;
count = count + tmp;
rem = rem - (100 * tmp);
}
if (rem >= 50) {
tmp = rem / 50;
count = count + tmp;
rem = rem - 50 * tmp;
}
if (rem >= 10) {
tmp = rem / 10;
count = count + tmp;
rem = rem - 10 * tmp;
}
if (rem >= 5) {
tmp = rem / 5;
count = count + tmp;
rem = rem - 5 * tmp;
}
count = count + rem;
cout << count << endl;
return 0;
}
return 0; | a.cc: In function 'int main()':
a.cc:39:18: error: expected '}' at end of input
39 | return 0;
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s052447221 | p00444 | C++ | #include<iostream>
using namespace std;
int main(){
int total;
int change;
int count=0;
while(true){
cin>>total;
if(total==0){
break;
}
change=1000-total;
while(true){
if(change>=500){
change-=500;
count++;
}else if(change>=100){
change-=100;
count++;
}else if(change>=50){
change-=50;
count++;
}else if(change>=10){
change-=10;
count++;
}else if(change>=5){
change-=5;
count++;
}else{
change--;
count++;
}
}
count<<count<<"\n";
count=0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:35:14: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
35 | count<<count<<"\n";
| ~~~~~~~~~~~~^~~~~~
| | |
| int const char [2]
|
s358044960 | p00444 | C++ | #include<iostream>
using namespace std;
int main(){
int m,t;
int p=0;
cin >> m;
if(m==0){
break;
}
t=1000-m;
while(1){
if(t>=500){
t-=500;
p++;
}else if(t>=100){
t-=100;
p++;
}else if(t>=50){
t-=50;
p++;
}else if(t>=10){
t-=10;
p++;
}else if(t>=5){
t-=5;
p++;
}else{
t--;
p++;
}
if(t==0){
break;
}
}
cout << p << '\n';
count=0;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:17: error: break statement not within loop or switch
9 | break;
| ^~~~~
a.cc:37:9: error: 'count' was not declared in this scope
37 | count=0;
| ^~~~~
|
s575353094 | p00444 | C++ | #include<iostream>
using namespace std;
int main(){
int buy,oturi,kouka;
while(1){
cin>>buy;
if(buy==0){
break;
}
oturi=1000-buy;
if(oturi>500){
oturi-=500;
kouka+=1;
}
while(oturi>=100){
oturi-=100;
kouka+=1;
}
while(oturi>=50){
oturi-=50;
kouka+=1;
}
while(oturi>=10){
oturi-=10;
kouka+=1;
}
while(oturi>=5){
oturi-=5;
kouka+=1;
}
while(oturi>=1){
oturi-=1;
kouka+=1;
}
cout<<kouka<<'\n';
}
}
return 0;
} | a.cc:39:1: error: expected unqualified-id before 'return'
39 | return 0;
| ^~~~~~
a.cc:40:1: error: expected declaration before '}' token
40 | }
| ^
|
s382955762 | p00444 | C++ | #include<iostream>
using namespace std;
int main(){
int n;while(true){cin>>n;if(n==0){break;}
cout<<n/500+(n/100)%5+(n/50)%2+(n/10)%5+(n/5)%2+n%5<<endl;} | a.cc: In function 'int main()':
a.cc:5:60: error: expected '}' at end of input
5 | cout<<n/500+(n/100)%5+(n/50)%2+(n/10)%5+(n/5)%2+n%5<<endl;}
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s430545282 | p00444 | C++ | #include <iostream>
using namespace std;
int main ()
{
int m1;
while(1)
{
cin>>m1;
if(m1>0||m1<1000)
{
break;
}
else
{
int m2,m3,m4,m5,m6,m7;
}
m2=1000-m1;
m3=m2/500;
m4=m2%500/100;
m5=m2%500%100/50;
m6=m2%500%100%50/10;
m7=m2%500%100%50%10/1;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:19:4: error: 'm2' was not declared in this scope; did you mean 'm1'?
19 | m2=1000-m1;
| ^~
| m1
a.cc:20:4: error: 'm3' was not declared in this scope; did you mean 'm1'?
20 | m3=m2/500;
| ^~
| m1
a.cc:21:4: error: 'm4' was not declared in this scope; did you mean 'm1'?
21 | m4=m2%500/100;
| ^~
| m1
a.cc:22:4: error: 'm5' was not declared in this scope; did you mean 'm1'?
22 | m5=m2%500%100/50;
| ^~
| m1
a.cc:23:4: error: 'm6' was not declared in this scope; did you mean 'm1'?
23 | m6=m2%500%100%50/10;
| ^~
| m1
a.cc:24:4: error: 'm7' was not declared in this scope; did you mean 'm1'?
24 | m7=m2%500%100%50%10/1;
| ^~
| m1
|
s461482036 | p00444 | C++ | #include <iostream>
using namespace std;
int main ()
{
int m1;
while(1)
{
cin>>m1;
if(m1>0||m1<=1000)
{
break;
}
else
{
int m2,m3,m4,m5,m6,m7;
}
m2=1000-m1;
m3=m2/500;
m4=m2%500/100;
m5=m2%500%100/50;
m6=m2%500%100%50/10;
m7=m2%500%100%50%10/1;
cout<<m3+m4+m5+m6+m7<<'\n';
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:19:4: error: 'm2' was not declared in this scope; did you mean 'm1'?
19 | m2=1000-m1;
| ^~
| m1
a.cc:20:4: error: 'm3' was not declared in this scope; did you mean 'm1'?
20 | m3=m2/500;
| ^~
| m1
a.cc:21:4: error: 'm4' was not declared in this scope; did you mean 'm1'?
21 | m4=m2%500/100;
| ^~
| m1
a.cc:22:4: error: 'm5' was not declared in this scope; did you mean 'm1'?
22 | m5=m2%500%100/50;
| ^~
| m1
a.cc:23:4: error: 'm6' was not declared in this scope; did you mean 'm1'?
23 | m6=m2%500%100%50/10;
| ^~
| m1
a.cc:24:4: error: 'm7' was not declared in this scope; did you mean 'm1'?
24 | m7=m2%500%100%50%10/1;
| ^~
| m1
|
s879984750 | p00444 | C++ | #include <iostream>
using namespace std;
int main ()
{
int m1;
while(1)
{
cin>>m1;
if(m1>0||m1<=1000)
{
break;
}
else
{
int m2,m3,m4,m5,m6,m7;
}
m2=1000-m1;
m3=m2/500;
m4=m2%500/100;
m5=m2%500%100/50;
m6=m2%500%100%50/10;
m7=m2%500%100%50%10/1;
cout<<m3+m4+m5+m6+m7<<'\n';
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:19:4: error: 'm2' was not declared in this scope; did you mean 'm1'?
19 | m2=1000-m1;
| ^~
| m1
a.cc:20:4: error: 'm3' was not declared in this scope; did you mean 'm1'?
20 | m3=m2/500;
| ^~
| m1
a.cc:21:4: error: 'm4' was not declared in this scope; did you mean 'm1'?
21 | m4=m2%500/100;
| ^~
| m1
a.cc:22:4: error: 'm5' was not declared in this scope; did you mean 'm1'?
22 | m5=m2%500%100/50;
| ^~
| m1
a.cc:23:4: error: 'm6' was not declared in this scope; did you mean 'm1'?
23 | m6=m2%500%100%50/10;
| ^~
| m1
a.cc:24:4: error: 'm7' was not declared in this scope; did you mean 'm1'?
24 | m7=m2%500%100%50%10/1;
| ^~
| m1
|
s565073700 | p00444 | C++ | #include<iostream>
using namespace std;
int main(){
int siharai,oturi=1;
int a,b,c,d,e,f;
while(oturi!=0){
cin>>siharai;
oturi=1000-siharai;
if(oturi>=500){
a=1;
oturi=oturi-500;
}
else{
a=0;
}
while(oturi>=100){
if(oturi>=100){
b=1;
oturi=oturi-100;
}
else
a=0;
}
while(oturi>=50){
if(oturi>=50){
c=1;
oturi=oturi-50;
}
else
c=0;
}
while(oturi>=10){
if(oturi>=10){
d=1;
oturi=oturi-10;
}
else
d=0;
}
while(oturi>=5){
if(oturi>=5){
e=1;
oturi=oturi-5;
}
else
e=0;
}
while(oturi>=1){
if(oturi>=1){
f=1;
oturi=oturi-1;
}
else
f=0;
}
}
cout<<a+b+c+d+e+f<<'\n';
return 0; | a.cc: In function 'int main()':
a.cc:65:10: error: expected '}' at end of input
65 | return 0;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s607017452 | p00444 | C++ | #include<iostream>
using namespace std;
int main(){
int price,cnt=0,div[6]=[500,100,50,10,5,1];
while(1){
cin>>price;
if(price==0)break;
price=1000-price;
for(i=0;i<6;i++){
if((price/div[i])!=0){
cnt+=(price/div[i]);
price-=(price/div[i])*div[i];
}
}
cout<<cnt<<endl;
cnt=0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:4:25: error: expected identifier before numeric constant
4 | int price,cnt=0,div[6]=[500,100,50,10,5,1];
| ^~~
a.cc:4:28: error: expected ']' before ',' token
4 | int price,cnt=0,div[6]=[500,100,50,10,5,1];
| ^
| ]
a.cc: In lambda function:
a.cc:4:28: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:4:24: error: array must be initialized with a brace-enclosed initializer
4 | int price,cnt=0,div[6]=[500,100,50,10,5,1];
| ^~~~
a.cc:4:29: error: expected unqualified-id before numeric constant
4 | int price,cnt=0,div[6]=[500,100,50,10,5,1];
| ^~~
a.cc:9:5: error: 'i' was not declared in this scope
9 | for(i=0;i<6;i++){
| ^
|
s391601847 | p00444 | C++ | #include<iostream>
using namespace std;
int main(){
int price,cnt=0,div[6]=[500,100,50,10,5,1]i;
while(1){
cin>>price;
if(price==0)break;
price=1000-price;
for(i=0;i<6;i++){
if((price/div[i])!=0){
cnt+=(price/div[i]);
price-=(price/div[i])*div[i];
}
}
cout<<cnt<<endl;
cnt=0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:4:25: error: expected identifier before numeric constant
4 | int price,cnt=0,div[6]=[500,100,50,10,5,1]i;
| ^~~
a.cc:4:28: error: expected ']' before ',' token
4 | int price,cnt=0,div[6]=[500,100,50,10,5,1]i;
| ^
| ]
a.cc: In lambda function:
a.cc:4:28: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:4:24: error: array must be initialized with a brace-enclosed initializer
4 | int price,cnt=0,div[6]=[500,100,50,10,5,1]i;
| ^~~~
a.cc:4:29: error: expected unqualified-id before numeric constant
4 | int price,cnt=0,div[6]=[500,100,50,10,5,1]i;
| ^~~
a.cc:9:5: error: 'i' was not declared in this scope
9 | for(i=0;i<6;i++){
| ^
|
s263341840 | p00444 | C++ | #include<iostream>
using namespace std;
int main(){
int price,cnt=0,div[6]=[500,100,50,10,5,1],i;
while(1){
cin>>price;
if(price==0)break;
price=1000-price;
for(i=0;i<6;i++){
if((price/div[i])!=0){
cnt+=(price/div[i]);
price-=(price/div[i])*div[i];
}
}
cout<<cnt<<endl;
cnt=0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:4:25: error: expected identifier before numeric constant
4 | int price,cnt=0,div[6]=[500,100,50,10,5,1],i;
| ^~~
a.cc:4:28: error: expected ']' before ',' token
4 | int price,cnt=0,div[6]=[500,100,50,10,5,1],i;
| ^
| ]
a.cc: In lambda function:
a.cc:4:28: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:4:24: error: array must be initialized with a brace-enclosed initializer
4 | int price,cnt=0,div[6]=[500,100,50,10,5,1],i;
| ^~~~
a.cc:4:29: error: expected unqualified-id before numeric constant
4 | int price,cnt=0,div[6]=[500,100,50,10,5,1],i;
| ^~~
a.cc:9:5: error: 'i' was not declared in this scope
9 | for(i=0;i<6;i++){
| ^
|
s864916719 | p00444 | C++ | #include<iostream>
using namespace std;
int main(){
int price,cnt=0;
int div[6]=[500,100,50,10,5,1];
int i;
while(1){
cin>>price;
if(price==0)break;
price=1000-price;
for(i=0;i<6;i++){
if((price/div[i])!=0){
cnt+=(price/div[i]);
price-=(price/div[i])*div[i];
}
}
cout<<cnt<<endl;
cnt=0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:13: error: expected identifier before numeric constant
5 | int div[6]=[500,100,50,10,5,1];
| ^~~
a.cc:5:16: error: expected ']' before ',' token
5 | int div[6]=[500,100,50,10,5,1];
| ^
| ]
a.cc: In lambda function:
a.cc:5:16: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:5:12: error: array must be initialized with a brace-enclosed initializer
5 | int div[6]=[500,100,50,10,5,1];
| ^~~~
a.cc:5:17: error: expected unqualified-id before numeric constant
5 | int div[6]=[500,100,50,10,5,1];
| ^~~
|
s715658534 | p00444 | C++ | #include <cstdio>
using namespace std;
int main()
{while(1){
int a;
scanf("%d",&a);
if(a==0) return 0;
a=1000-a;
printf("%d\n",a/500a+(a/100)%5+(a/50)%2+(a/10)%5+(a/5)%2+a%5;}
} | a.cc: In function 'int main()':
a.cc:9:18: error: unable to find numeric literal operator 'operator""a'
9 | printf("%d\n",a/500a+(a/100)%5+(a/50)%2+(a/10)%5+(a/5)%2+a%5;}
| ^~~~
|
s176692151 | p00444 | C++ | #include <cstdio>
using namespace std;
int main()
{while(1){
int a;
scanf("%d",&a);
if(a==0) return 0;
a=1000-a;
printf("%d\n",a/500a+(a/100)%5+(a/50)%2+(a/10)%5+(a/5)%2+a%5);}
} | a.cc: In function 'int main()':
a.cc:9:18: error: unable to find numeric literal operator 'operator""a'
9 | printf("%d\n",a/500a+(a/100)%5+(a/50)%2+(a/10)%5+(a/5)%2+a%5);}
| ^~~~
|
s577952574 | p00444 | C++ | #include<iostream>
using namespace std;
int main()
{
int money,count,maisu = 0,oturi[1000] = {};
int money2[6] = {500,100,50,10,5,1};
for(int i = 0;i >= 0;i++){
cin >> money;
count++;
if(money == 0)
break;
oturi[] = 1000 - money;
}
for(int j = 0;j < count;j++){
for(int i = 0;i < 6;i++){
maisu += oturi[j] / money2[i];
oturi[j] %= money2[i];
}
}
cout << maisu << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:11: error: expected primary-expression before ']' token
13 | oturi[] = 1000 - money;
| ^
|
s187656199 | p00444 | C++ | #include <stdio.h>
int main(){
int okane;
int oturi;
int count = 0;
int a[] = { 1, 5, 10, 50, 100, 500 };
scanf_s("%d", &okane);
oturi = 1000 - okane;
for (int i = 5; i >= 0; i--){
if (okane >= a[i]){
okane = okane - a[i];
count = count + 1;
}
}
printf("%d\n",count);
return 0;
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
9 | scanf_s("%d", &okane);
| ^~~~~~~
| scanf
|
s496463388 | p00444 | C++ | #include <stdio.h>
void main(){
int okane;
int oturi;
int count = 0;
int a[] = { 1, 5, 10, 50, 100, 500 };
scanf_s("%d", &okane);
oturi = 1000 - okane;
for (int i = 5; i >= 0; i--){
if (okane >= a[i]){
okane = okane - a[i];
count = count + 1;
}
}
printf("%d\n",count);
} | a.cc:3:1: error: '::main' must return 'int'
3 | void main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
9 | scanf_s("%d", &okane);
| ^~~~~~~
| scanf
|
s337369834 | p00444 | C++ | #include <stdio.h>
void main(){
int okane;
int oturi;
int count = 0;
int a[] = { 1, 5, 10, 50, 100, 500 };
scanf("%d", &okane);
oturi = 1000 - okane;
for (int i = 5; i >= 0; i--){
if (okane >= a[i]){
okane = okane - a[i];
count = count + 1;
}
}
printf("%d\n",count);
} | a.cc:3:1: error: '::main' must return 'int'
3 | void main(){
| ^~~~
|
s358287985 | p00444 | C++ | #include <stdio.h>
void main(){
int okane;
int oturi;
int count = 0;
int a[] = { 1, 5, 10, 50, 100, 500 };
scanf("%d", &okane);
oturi = 1000 - okane;
for (int i = 5; i >= 0; i--){
if (okane >= a[i]){
okane = okane - a[i];
count = count + 1;
}
}
printf("%d\n",count);
} | a.cc:3:1: error: '::main' must return 'int'
3 | void main(){
| ^~~~
|
s850924947 | p00444 | C++ | #include <stdio.h>
#include <stdlib.h>
int main(){
int okane;
int oturi;
int count = 0;
int a[] = { 1, 5, 10, 50, 100, 500 };
scanf_s("%d", &okane);
oturi = 1000 - okane;
for (int i = 5; i >= 0; i--){
if (oturi >= a[i]){
div_t d;
d = div(oturi, a[i]);
oturi = oturi - a[i] * d.quot;
count = count + d.quot;
}
}
printf("%d\n",count);
return 0;
div(20, 3);
} | a.cc: In function 'int main()':
a.cc:10:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
10 | scanf_s("%d", &okane);
| ^~~~~~~
| scanf
|
s861225422 | p00444 | C++ | #include <stdio.h>
#include <stdlib.h>
int main(){
int okane;
int oturi;
int count = 0;
int a[] = { 1, 5, 10, 50, 100, 500 };
scanf_s("%d", &okane);
oturi = 1000 - okane;
for (int i = 5; i >= 0; i--){
if (oturi >= a[i]){
div_t d;
d = div(oturi, a[i]);
oturi = oturi - a[i] * d.quot;
count = count + d.quot;
}
}
printf("%d\n",count);
return 0;
div(20, 3);
} | a.cc: In function 'int main()':
a.cc:10:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
10 | scanf_s("%d", &okane);
| ^~~~~~~
| scanf
|
s293704247 | p00444 | C++ |
Beta
paiza.IO
??°????????????
?????§
???????????????
??\??¬???
???????????¢??????
?????°??????
???
C++ Split Button!
Main.cpp ???
+
Success
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
cent++;
}
while (pay >= 100){
pay -= 100;
cent++;
}
while (pay >= 50){
pay -= 50;
cent++;
}
while (pay >= 10){
pay -= 10;
cent++;
}
while (pay >= 5){
pay -= 5;
cent++;
}
while (pay >= 1){
??± ?????? (Ctrl-Enter) Split Button!
??? ??? ??? ??£
???
??? ??? ???
???
???
??????
??\???
???????????? 0
(0.00 sec)
TextHTMLJSON ???
3
15
4
SumoMe
Beta
paiza.IO
??°????????????
?????§
???????????????
??\??¬???
???????????¢??????
?????°??????
???
C++ Split Button!
Main.cpp ???
+
Success
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
cent++;
}
while (pay >= 100){
pay -= 100;
cent++;
}
while (pay >= 50){
pay -= 50;
cent++;
}
while (pay >= 10){
pay -= 10;
cent++;
}
while (pay >= 5){
pay -= 5;
cent++;
}
while (pay >= 1){
??± ?????? (Ctrl-Enter) Split Button!
??? ??? ??? ??£
???
??? ??? ???
???
???
??????
??\???
???????????? 0
(0.00 sec)
TextHTMLJSON ???
3
15
4
SumoMe
Beta
paiza.IO
??°????????????
?????§
???????????????
??\??¬???
???????????¢??????
?????°??????
???
C++ Split Button!
Main.cpp ???
+
Success
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
cent++;
}
while (pay >= 100){
pay -= 100;
cent++;
}
while (pay >= 50){
pay -= 50;
cent++;
}
while (pay >= 10){
pay -= 10;
cent++;
}
while (pay >= 5){
pay -= 5;
cent++;
}
while (pay >= 1){
??± ?????? (Ctrl-Enter) Split Button!
??? ??? ??? ??£
???
??? ??? ???
???
???
??????
??\???
???????????? 0
(0.00 sec)
TextHTMLJSON ???
3
15
4
SumoMe
#include <iostream>
using namespace std;
int main(void){
// Here your code !
int n = 1;
int pay ;
while (n){
int cent = 0;
cin >>n;
if (n==0){
break;
}
pay = 1000 - n;
if (pay >= 500){
pay -= 500;
cent++;
}
while (pay >= 100){
pay -= 100;
cent++;
}
while (pay >= 50){
pay -= 50;
cent++;
}
while (pay >= 10){
pay -= 10;
cent++;
}
while (pay >= 5){
pay -= 5;
cent++;
}
while (pay >= 1){
pay -= 1;
cent++;
}
cout << cent << "\n";
}
return 0;
} | a.cc:20:4: error: extended character ° is not valid in an identifier
20 | ??°????????????
| ^
a.cc:23:6: error: extended character § is not valid in an identifier
23 | ?????§
| ^
a.cc:29:4: error: stray '\' in program
29 | ??\??¬???
| ^
a.cc:29:7: error: extended character ¬ is not valid in an identifier
29 | ??\??¬???
| ^
a.cc:37:12: error: extended character ¢ is not valid in an identifier
37 | ???????????¢??????
| ^
a.cc:39:6: error: extended character ° is not valid in an identifier
39 | ?????°??????
| ^
a.cc:128:1: error: stray '\1' in program
128 | <U+0001><U+0001>
| ^~~~~~~~
a.cc:128:2: error: stray '\1' in program
128 | <U+0001><U+0001>
| ^~~~~~~~
a.cc:199:3: error: extended character ± is not valid in an identifier
199 | ??± ?????? (Ctrl-Enter) Split Button!
| ^
a.cc:212:26: error: extended character £ is not valid in an identifier
212 | ??? ??? ??? ??£
| ^
a.cc:235:4: error: stray '\' in program
235 | ??\???
| ^
a.cc:445:4: error: extended character ° is not valid in an identifier
445 | ??°????????????
| ^
a.cc:448:6: error: extended character § is not valid in an identifier
448 | ?????§
| ^
a.cc:454:4: error: stray '\' in program
454 | ??\??¬???
| ^
a.cc:454:7: error: extended character ¬ is not valid in an identifier
454 | ??\??¬???
| ^
a.cc:462:12: error: extended character ¢ is not valid in an identifier
462 | ???????????¢??????
| ^
a.cc:464:6: error: extended character ° is not valid in an identifier
464 | ?????°??????
| ^
a.cc:553:1: error: stray '\1' in program
553 | <U+0001><U+0001>
| ^~~~~~~~
a.cc:553:2: error: stray '\1' in program
553 | <U+0001><U+0001>
| ^~~~~~~~
a.cc:624:3: error: extended character ± is not valid in an identifier
624 | ??± ?????? (Ctrl-Enter) Split Button!
| ^
a.cc:637:26: error: extended character £ is not valid in an identifier
637 | ??? ??? ??? ??£
| ^
a.cc:660:4: error: stray '\' in program
660 | ??\???
| ^
a.cc:825:4: error: extended character ° is not valid in an identifier
825 | ??°????????????
| ^
a.cc:828:6: error: extended character § is not valid in an identifier
828 | ?????§
| ^
a.cc:834:4: error: stray '\' in program
834 | ??\??¬???
| ^
a.cc:834:7: error: extended character ¬ is not valid in an identifier
834 | ??\??¬???
| ^
a.cc:842:12: error: extended character ¢ is not valid in an identifier
842 | ???????????¢??????
| ^
a.cc:844:6: error: extended character ° is not valid in an identifier
844 | ?????°??????
| ^
a.cc:933:1: error: stray '\1' in program
933 | <U+0001><U+0001>
| ^~~~~~~~
a.cc:933:2: error: stray '\1' in program
933 | <U+0001><U+0001>
| ^~~~~~~~
a.cc:1004:3: error: extended character ± is not valid in an identifier
1004 | ??± ?????? (Ctrl-Enter) Split Button!
| ^
a.cc:1017:26: error: extended character £ is not valid in an identifier
1017 | ??? ??? ??? ??£
| ^
a.cc:1040:4: error: stray '\' in program
1040 | ??\???
| ^
a.cc:11:1: error: 'Beta' does not name a type
11 | Beta
| ^~~~
a.cc:162:5: error: expected declaration before '}' token
162 | }
| ^
a.cc:164:5: error: expected unqualified-id before 'while'
164 | while (pay >= 100){
| ^~~~~
a.cc:169:5: error: expected unqualified-id before 'while'
169 | while (pay >= 50){
| ^~~~~
a.cc:174:5: error: expected unqualified-id before 'while'
174 | while (pay >= 10){
| ^~~~~
a.cc:179:5: error: expected unqualified-id before 'while'
179 | while (pay >= 5){
| ^~~~~
a.cc:184:5: error: expected unqualified-id before 'while'
184 | while (pay >= 1){
| ^~~~~
a.cc:589:5: error: expected unqualified-id before 'while'
589 | while (pay >= 100){
| ^~~~~
a.cc:594:5: error: expected unqualified-id before 'while'
594 | while (pay >= 50){
| ^~~~~
a.cc:599:5: error: expected unqualified-id before 'while'
599 | while (pay >= 10){
| ^~~~~
a.cc:604:5: error: expected unqualified-id before 'while'
604 | while (pay >= 5){
| ^~~~~
a.cc:609:5: error: expected unqualified-id before 'while'
609 | while (pay >= 1){
| ^~~~~
a.cc:969:5: error: expected unqualified-id before 'while'
969 | while (pay >= 100){
| ^~~~~
a.cc:974:5: error: expected unqualified-id before 'while'
974 | while (pay >= 50){
| ^~~~~
a.cc:979:5: error: expected unqualified-id before 'while'
979 | while (pay >= 10){
| ^~~~~
a.cc:984:5: error: expected unqualified-id before 'while'
984 | while (pay >= 5){
| ^~~~~
a.cc:989:5: error: expected unqualified-id before 'while'
989 | while (pay >= 1){
| ^~~~~
|
s218560763 | p00444 | C++ |
Beta
paiza.IO
??°????????????
?????§
???????????????
??\??¬???
???????????¢??????
?????°??????
???
C++ Split Button!
Main.cpp ???
+
Success
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
cent++;
}
while (pay >= 100){
pay -= 100;
cent++;
}
while (pay >= 50){
pay -= 50;
cent++;
}
while (pay >= 10){
pay -= 10;
cent++;
}
while (pay >= 5){
pay -= 5;
cent++;
}
while (pay >= 1){
??± ?????? (Ctrl-Enter) Split Button!
??? ??? ??? ??£
???
??? ??? ???
???
???
??????
??\???
???????????? 0
(0.00 sec)
TextHTMLJSON ???
3
15
4
SumoMe
Beta
paiza.IO
??°????????????
?????§
???????????????
??\??¬???
???????????¢??????
?????°??????
???
C++ Split Button!
Main.cpp ???
+
Success
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
cent++;
}
while (pay >= 100){
pay -= 100;
cent++;
}
while (pay >= 50){
pay -= 50;
cent++;
}
while (pay >= 10){
pay -= 10;
cent++;
}
while (pay >= 5){
pay -= 5;
cent++;
}
while (pay >= 1){
??± ?????? (Ctrl-Enter) Split Button!
??? ??? ??? ??£
???
??? ??? ???
???
???
??????
??\???
???????????? 0
(0.00 sec)
TextHTMLJSON ???
3
15
4
SumoMe
Beta
paiza.IO
??°????????????
?????§
???????????????
??\??¬???
???????????¢??????
?????°??????
???
C++ Split Button!
Main.cpp ???
+
Success
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
cent++;
}
while (pay >= 100){
pay -= 100;
cent++;
}
while (pay >= 50){
pay -= 50;
cent++;
}
while (pay >= 10){
pay -= 10;
cent++;
}
while (pay >= 5){
pay -= 5;
cent++;
}
while (pay >= 1){
??± ?????? (Ctrl-Enter) Split Button!
??? ??? ??? ??£
???
??? ??? ???
???
???
??????
??\???
???????????? 0
(0.00 sec)
TextHTMLJSON ???
3
15
4
SumoMe
#include <iostream>
using namespace std;
int main(void){
// Here your code !
int n = 1;
int pay ;
while (n){
int cent = 0;
cin >>n;
if (n==0){
break;
}
pay = 1000 - n;
if (pay >= 500){
pay -= 500;
cent++;
}
while (pay >= 100){
pay -= 100;
cent++;
}
while (pay >= 50){
pay -= 50;
cent++;
}
while (pay >= 10){
pay -= 10;
cent++;
}
while (pay >= 5){
pay -= 5;
cent++;
}
while (pay >= 1){
pay -= 1;
cent++;
}
cout << cent << "\n";
}
return 0;
} | a.cc:20:4: error: extended character ° is not valid in an identifier
20 | ??°????????????
| ^
a.cc:23:6: error: extended character § is not valid in an identifier
23 | ?????§
| ^
a.cc:29:4: error: stray '\' in program
29 | ??\??¬???
| ^
a.cc:29:7: error: extended character ¬ is not valid in an identifier
29 | ??\??¬???
| ^
a.cc:37:12: error: extended character ¢ is not valid in an identifier
37 | ???????????¢??????
| ^
a.cc:39:6: error: extended character ° is not valid in an identifier
39 | ?????°??????
| ^
a.cc:128:1: error: stray '\1' in program
128 | <U+0001><U+0001>
| ^~~~~~~~
a.cc:128:2: error: stray '\1' in program
128 | <U+0001><U+0001>
| ^~~~~~~~
a.cc:199:3: error: extended character ± is not valid in an identifier
199 | ??± ?????? (Ctrl-Enter) Split Button!
| ^
a.cc:212:26: error: extended character £ is not valid in an identifier
212 | ??? ??? ??? ??£
| ^
a.cc:235:4: error: stray '\' in program
235 | ??\???
| ^
a.cc:445:4: error: extended character ° is not valid in an identifier
445 | ??°????????????
| ^
a.cc:448:6: error: extended character § is not valid in an identifier
448 | ?????§
| ^
a.cc:454:4: error: stray '\' in program
454 | ??\??¬???
| ^
a.cc:454:7: error: extended character ¬ is not valid in an identifier
454 | ??\??¬???
| ^
a.cc:462:12: error: extended character ¢ is not valid in an identifier
462 | ???????????¢??????
| ^
a.cc:464:6: error: extended character ° is not valid in an identifier
464 | ?????°??????
| ^
a.cc:553:1: error: stray '\1' in program
553 | <U+0001><U+0001>
| ^~~~~~~~
a.cc:553:2: error: stray '\1' in program
553 | <U+0001><U+0001>
| ^~~~~~~~
a.cc:624:3: error: extended character ± is not valid in an identifier
624 | ??± ?????? (Ctrl-Enter) Split Button!
| ^
a.cc:637:26: error: extended character £ is not valid in an identifier
637 | ??? ??? ??? ??£
| ^
a.cc:660:4: error: stray '\' in program
660 | ??\???
| ^
a.cc:825:4: error: extended character ° is not valid in an identifier
825 | ??°????????????
| ^
a.cc:828:6: error: extended character § is not valid in an identifier
828 | ?????§
| ^
a.cc:834:4: error: stray '\' in program
834 | ??\??¬???
| ^
a.cc:834:7: error: extended character ¬ is not valid in an identifier
834 | ??\??¬???
| ^
a.cc:842:12: error: extended character ¢ is not valid in an identifier
842 | ???????????¢??????
| ^
a.cc:844:6: error: extended character ° is not valid in an identifier
844 | ?????°??????
| ^
a.cc:933:1: error: stray '\1' in program
933 | <U+0001><U+0001>
| ^~~~~~~~
a.cc:933:2: error: stray '\1' in program
933 | <U+0001><U+0001>
| ^~~~~~~~
a.cc:1004:3: error: extended character ± is not valid in an identifier
1004 | ??± ?????? (Ctrl-Enter) Split Button!
| ^
a.cc:1017:26: error: extended character £ is not valid in an identifier
1017 | ??? ??? ??? ??£
| ^
a.cc:1040:4: error: stray '\' in program
1040 | ??\???
| ^
a.cc:11:1: error: 'Beta' does not name a type
11 | Beta
| ^~~~
a.cc:162:5: error: expected declaration before '}' token
162 | }
| ^
a.cc:164:5: error: expected unqualified-id before 'while'
164 | while (pay >= 100){
| ^~~~~
a.cc:169:5: error: expected unqualified-id before 'while'
169 | while (pay >= 50){
| ^~~~~
a.cc:174:5: error: expected unqualified-id before 'while'
174 | while (pay >= 10){
| ^~~~~
a.cc:179:5: error: expected unqualified-id before 'while'
179 | while (pay >= 5){
| ^~~~~
a.cc:184:5: error: expected unqualified-id before 'while'
184 | while (pay >= 1){
| ^~~~~
a.cc:589:5: error: expected unqualified-id before 'while'
589 | while (pay >= 100){
| ^~~~~
a.cc:594:5: error: expected unqualified-id before 'while'
594 | while (pay >= 50){
| ^~~~~
a.cc:599:5: error: expected unqualified-id before 'while'
599 | while (pay >= 10){
| ^~~~~
a.cc:604:5: error: expected unqualified-id before 'while'
604 | while (pay >= 5){
| ^~~~~
a.cc:609:5: error: expected unqualified-id before 'while'
609 | while (pay >= 1){
| ^~~~~
a.cc:969:5: error: expected unqualified-id before 'while'
969 | while (pay >= 100){
| ^~~~~
a.cc:974:5: error: expected unqualified-id before 'while'
974 | while (pay >= 50){
| ^~~~~
a.cc:979:5: error: expected unqualified-id before 'while'
979 | while (pay >= 10){
| ^~~~~
a.cc:984:5: error: expected unqualified-id before 'while'
984 | while (pay >= 5){
| ^~~~~
a.cc:989:5: error: expected unqualified-id before 'while'
989 | while (pay >= 1){
| ^~~~~
|
s003735640 | p00444 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
while(cin>>n,n){
p=1000,s=0;
p-=n;
s+=p/500;
p%=500;
s+=p/100;
p%=100;
s+=p/50;
p%=50;
s+=p/10;
p%=10;
s+=p/5;
p%=5;
s+=p/1;
p%=1;
cout<<s<<endl;}
} | a.cc: In function 'int main()':
a.cc:6:1: error: 'p' was not declared in this scope
6 | p=1000,s=0;
| ^
a.cc:6:8: error: 's' was not declared in this scope
6 | p=1000,s=0;
| ^
|
s277595295 | p00444 | C++ | ???#include <bits/stdc++.h>
#define MP make_pair
#define PB push_back
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define RANGEBOX(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
#define RANGE(x, l, r) ((l) <= (x) && (x) <= (r))
#define rep(i, N) for (int i = 0; i < (int)(N); i++)
#define rrep(i, N) for (int i = N - 1; i >= 0; i--)
#define REP(i, init, N) for (int i = (init); i < (int)(N); i++)
#define RREP(i, N, last) for (int i = (init - 1); i >= last; i--)
#define PB push_back
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVi;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;
const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double DINF = 0x3f3f3f3f;
int main(){
ios::sync_with_stdio(false);
int sum=0;
int x;
int cnt=0;
while(1){
cin>>x;
if(!x)
return 0;
sum=1000-x;
while(sum>0){
if(sum>=500){
cnt++;
sum-=500;
}
else if(sum>=100){
cnt++;
sum-=100;
}
else if(sum>=50){
cnt++;
sum-=50;
}
else if(sum>=10){
cnt++;
sum-=10;
}
else if(sum>=5){
cnt++;
sum-=5;
}
else{
cnt++;
sum-=1;
}
}
cout<<cnt<<endl;
cnt=0;
}
return 0;
} | a.cc:1:4: error: stray '#' in program
1 | ???#include <bits/stdc++.h>
| ^
a.cc:1:1: error: expected unqualified-id before '?' token
1 | ???#include <bits/stdc++.h>
| ^
a.cc:19:9: error: 'vector' does not name a type
19 | typedef vector<int> VI;
| ^~~~~~
a.cc:20:9: error: 'vector' does not name a type
20 | typedef vector<VI > VVi;
| ^~~~~~
a.cc:21:9: error: 'vector' does not name a type
21 | typedef vector<string> VS;
| ^~~~~~
a.cc:22:9: error: 'vector' does not name a type
22 | typedef vector<LL> VLL;
| ^~~~~~
a.cc:23:9: error: 'pair' does not name a type
23 | typedef pair<int,int> PII;
| ^~~~
a.cc: In function 'int main()':
a.cc:30:9: error: 'ios' has not been declared
30 | ios::sync_with_stdio(false);
| ^~~
a.cc:35:9: error: 'cin' was not declared in this scope
35 | cin>>x;
| ^~~
a.cc:65:9: error: 'cout' was not declared in this scope
65 | cout<<cnt<<endl;
| ^~~~
a.cc:65:20: error: 'endl' was not declared in this scope
65 | cout<<cnt<<endl;
| ^~~~
|
s343124555 | p00444 | C++ | // ???#include <bits/stdc++.h>
#include <iostream>
// #define MP make_pair
// #define PB push_back
// #define ALL(x) (x).begin(),(x).end()
// #define RALL(x) (x).rbegin(),(x).rend()
// #define RANGEBOX(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
// #define RANGE(x, l, r) ((l) <= (x) && (x) <= (r))
// #define rep(i, N) for (int i = 0; i < (int)(N); i++)
// #define rrep(i, N) for (int i = N - 1; i >= 0; i--)
// #define REP(i, init, N) for (int i = (init); i < (int)(N); i++)
// #define RREP(i, N, last) for (int i = (init - 1); i >= last; i--)
// #define PB push_back
using namespace std;
// typedef long long LL;
// typedef unsigned long long ULL;
// typedef vector<int> VI;
// typedef vector<VI > VVi;
// typedef vector<string> VS;
// typedef vector<LL> VLL;
// typedef pair<int,int> PII;
const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double DINF = 0x3f3f3f3f;
int main(){
ios::sync_with_stdio(false);
int sum=0;
int x;
int cnt=0;
while(1){
cin>>x;
if(!x)
return 0;
sum=1000-x;
while(sum>0){
if(sum>=500){
cnt++;
sum-=500;
}
else if(sum>=100){
cnt++;
sum-=100;
}
else if(sum>=50){
cnt++;
sum-=50;
}
else if(sum>=10){
cnt++;
sum-=10;
}
else if(sum>=5){
cnt++;
sum-=5;
}
else{
cnt++;
sum-=1;
}
}
cout<<cnt<<endl;
cnt=0;
}
return 0;
} | a.cc:27:7: error: 'LL' does not name a type
27 | const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
| ^~
|
s196844398 | p00444 | C++ | // ???#include <bits/stdc++.h>
#include <iostream>
// #define MP make_pair
// #define PB push_back
// #define ALL(x) (x).begin(),(x).end()
// #define RALL(x) (x).rbegin(),(x).rend()
// #define RANGEBOX(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
// #define RANGE(x, l, r) ((l) <= (x) && (x) <= (r))
// #define rep(i, N) for (int i = 0; i < (int)(N); i++)
// #define rrep(i, N) for (int i = N - 1; i >= 0; i--)
// #define REP(i, init, N) for (int i = (init); i < (int)(N); i++)
// #define RREP(i, N, last) for (int i = (init - 1); i >= last; i--)
// #define PB push_back
using namespace std;
// typedef long long LL;
// typedef unsigned long long ULL;
// typedef vector<int> VI;
// typedef vector<VI > VVi;
// typedef vector<string> VS;
// typedef vector<LL> VLL;
// typedef pair<int,int> PII;
const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double DINF = 0x3f3f3f3f;
int main(){
ios::sync_with_stdio(false);
int sum=0;
int x;
int cnt=0;
while(1){
cin>>x;
if(!x)
return 0;
sum=1000-x;
while(sum>0){
if(sum>=500){
cnt++;
sum-=500;
}
else if(sum>=100){
cnt++;
sum-=100;
}
else if(sum>=50){
cnt++;
sum-=50;
}
else if(sum>=10){
cnt++;
sum-=10;
}
else if(sum>=5){
cnt++;
sum-=5;
}
else{
cnt++;
sum-=1;
}
}
cout<<cnt<<endl;
cnt=0;
}
return 0;
} | a.cc:27:7: error: 'LL' does not name a type
27 | const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
| ^~
|
s035523353 | p00444 | C++ | // ???#include <bits/stdc++.h>
#include <iostream>
// #define MP make_pair
// #define PB push_back
// #define ALL(x) (x).begin(),(x).end()
// #define RALL(x) (x).rbegin(),(x).rend()
// #define RANGEBOX(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
// #define RANGE(x, l, r) ((l) <= (x) && (x) <= (r))
// #define rep(i, N) for (int i = 0; i < (int)(N); i++)
// #define rrep(i, N) for (int i = N - 1; i >= 0; i--)
// #define REP(i, init, N) for (int i = (init); i < (int)(N); i++)
// #define RREP(i, N, last) for (int i = (init - 1); i >= last; i--)
// #define PB push_back
using namespace std;
// typedef long long LL;
// typedef unsigned long long ULL;
// typedef vector<int> VI;
// typedef vector<VI > VVi;
// typedef vector<string> VS;
// typedef vector<LL> VLL;
// typedef pair<int,int> PII;
const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double DINF = 0x3f3f3f3f;
int main(){
ios::sync_with_stdio(false);
int sum=0;
int x;
int cnt=0;
while(1){
cin>>x;
if(!x)
return 0;
sum=1000-x;
while(sum>0){
if(sum>=500){
cnt++;
sum-=500;
}
else if(sum>=100){
cnt++;
sum-=100;
}
else if(sum>=50){
cnt++;
sum-=50;
}
else if(sum>=10){
cnt++;
sum-=10;
}
else if(sum>=5){
cnt++;
sum-=5;
}
else{
cnt++;
sum-=1;
}
}
cout<<cnt<<endl;
cnt=0;
}
return 0;
} | a.cc:27:7: error: 'LL' does not name a type
27 | const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
| ^~
|
s705860000 | p00444 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
#define print(a) printf("%d\n", a)
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define MAX(a,b) ((a)>(b)?(a):(b))
int main(){
int co, mod, ch = 0;
while (cin >> co != EOF){
mod = 1000 - co;
ch += mod/500;
mod = mod%500;
ch += mod/100;
mod = mod%100;
ch += mod/50;
mod = mod%50;
ch += mod/10;
mod = mod%10;
ch += mod/5;
mod = mod%5;
ch += mod;
cout << ch << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:17:26: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
17 | while (cin >> co != EOF){
| ~~~~~~~~~ ^~
| |
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
a.cc:17:26: note: candidate: 'operator!=(int, int)' (built-in)
17 | while (cin >> co != EOF){
| ^
a.cc:17:26: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)'
197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/cstdio:42,
from /usr/include/c++/14/ext/string_conversions.h:45,
from /usr/include/c++/14/bits/basic_string.h:4154,
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:
a.cc:17:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::fpos<_StateT>'
17 | while (cin >> co != EOF){
| ^~~
In file included from /usr/include/c++/14/string:43:
/usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)'
243 | operator!=(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed:
a.cc:17:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::allocator<_CharT>'
17 | while (cin >> co != EOF){
| ^~~
In file included from /usr/include/c++/14/string:48:
/usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
455 | operator!=(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed:
a.cc:17:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
17 | while (cin >> co != EOF){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
500 | operator!=(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed:
a.cc:17:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
17 | while (cin >> co != EOF){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1686 | operator!=(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed:
a.cc:17:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
17 | while (cin >> co != EOF){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1753 | operator!=(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed:
a.cc:17:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
17 | while (cin >> co != EOF){
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed:
a.cc:17:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>'
17 | while (cin >> co != EOF){
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47:
/usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
651 | operator!=(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed:
a.cc:17:29: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
17 | while (cin >> co != EOF){
| ^~~
/usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
658 | operator!=(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed:
a.cc:17:29: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
17 | while (cin >> co != EOF){
| ^~~
/usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed:
a.cc:17:29: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
17 | while (cin >> co != EOF){
| ^~~
/usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed:
a.cc:17:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
17 | while (cin >> co != EOF){
| ^~~
/usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3847 | operator!=(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed:
a.cc:17:29: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>'
17 | while (cin >> co != EOF){
| ^~~
/usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed:
a.cc:17:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
17 | while (cin >> co != EOF){
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2613 | operator!=(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed:
a.cc:17:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::tuple<_UTypes ...>'
17 | |
s636657725 | p00444 | C++ | #include <iostream>
using namespace std;
int main() {
ios::sync_with_std(false);
int n[5], count=0;
for (int i=0; i<5; i++) cin >> n[i];
for (int i=0;i<5;i++) {
if(n[i] == 0) break;
int s=1000 - n[i];
int j = (s - s % 500)/500;
count += j;
s -= j*500;
j = (s - s % 100)/100;
count += j;
s -= j*100;
j = (s - s % 100)/100;
count += j;
s -= j*50;
j = (s - s % 50)/50;
count += j;
s -= j*10;
j = (s - s % 10)/10;
count += j;
s -= j*10;
j = (s - s % 5)/5;
count += j;
s -= j*5;
count += s;
cout << count << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:10: error: 'sync_with_std' is not a member of 'std::ios' {aka 'std::basic_ios<char>'}
6 | ios::sync_with_std(false);
| ^~~~~~~~~~~~~
|
s060749374 | p00444 | C++ | #include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
int n[5], count=0, coin = { 500,100,50,10,5 };
for (int i=0; i<5; i++) cin >> n[i];
for (int i=0;i<5;i++) {
if(n[i] == 0) break;
int s=1000 - n[i];
for (int j=0;j<5;j++) {
int m = s / coin[j];
count += m;
s -= m * coin[j];
}
count += s;
cout << count << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:24: error: scalar object 'coin' requires one element in initializer
7 | int n[5], count=0, coin = { 500,100,50,10,5 };
| ^~~~
|
s289144615 | p00444 | C++ | #include<iostream>
#include<stdio.h>
using namespace std;
int main(){
int coin=0;
int price=0;
int flag=0;
cin>>price;
price=1000-price;
while(1){
if(flag==1){
break;
}
if(price>=500){
price=price-500;
coin=coin+1;
}
else if(price>=100){
price=price-100;
coin=coin+1;
}
else if(price>=50){
price=price-50;
coin=coin+1 ;
}
else if(price>=10){
price=price-10;
coin=coin+1 ;
}
else if(price>=5){
price=price-5;
coin=coin+1 ;
}
else if(price>=1){
price=price-1;
coin=coin+1 ;
}
else if(price==0){
flag=1;
}
}
if(coins!=0){
cout<<coin<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:42:12: error: 'coins' was not declared in this scope; did you mean 'coin'?
42 | if(coins!=0){
| ^~~~~
| coin
|
s355249529 | p00444 | C++ | #include<bits/stdc++.h>
using namespace std;
const int V[6]={1,5,10,50,100,500};
int C[6],A;
void main(){
int ans=0;
for(int i=5;i>=0;i--){
int t=min(A/V[i],C[i]);
A-=t*V[i];
ans+=t;
}
printf("%d\n",ans);
}
| a.cc:6:1: error: '::main' must return 'int'
6 | void main(){
| ^~~~
|
s913846623 | p00444 | C++ | #include<bits/stdc++.h>
using namespace std;
const int V[6]={1,5,10,50,100,500};
int C[6],A;
void main(){
int ans=0;
for(int i=5;i>=0;i--){
int t=min(A/V[i],C[i]);
A-=t*V[i];
ans+=t;
}
printf("%d\n",ans);
return 0;
}
| a.cc:6:1: error: '::main' must return 'int'
6 | void main(){
| ^~~~
|
s429924475 | p00444 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
/*
//数あて
int n;
cin >> n;
int p[200][3];
#include<iostream>
#include<string>
using namespace std;
int main(){
/*
//数あて
int n;
cin >> n;
int p[200][3];
for(int i=0;i<n;i++)
{
cin >> p[i][0] >> p[i][1] >> p[i][2];
}
int _p;
for(int k=0;k<3;k++)
{
for(int i=0;i<n;i++)
{
_p = p[i][k];
for(int j=i+1;j<n;j++)
{
if(_p == p[j][k])
{
p[i][k] = 0;
p[j][k] = 0;
}
}
}
}
for(int i=0;i<n;i++)
{
cout << p[i][0] + p[i][1] + p[i][2] << endl;
}
*/
/*
//得点
int ai,am,as,ae,bi,bm,bs,be;
cin >> ai >> am >> as >> ae >> bi >> bm >> bs >> be;
int answer=ai+am+as+ae;
if(answer < bi+bm+bs+be)
{
answer=bi+bm+bs+be;
}
cout << answer << endl;
*/
//おつり
while(true){
int N;
if(N == 0) break;
int nedan;
cin >> nedan;
int oturi = 1000-nedan;
int onum= 0;
if(oturi >= 500)
{
onum++;
oturi -= 500;
}
while(oturi>=100)
{
onum++;
oturi -= 100;
}
if(oturi >= 50)
{
onum++;
oturi -= 50;
}
while(oturi>=10)
{
onum++;
oturi -= 10;
}
if(oturi >= 5)
{
onum++;
oturi -= 5;
}
while(oturi>=1)
{
onum++;
oturi -= 1;
}
cout << onum << endl;
}
return 0;
}
for(int i=0;i<n;i++)
{
cin >> p[i][0] >> p[i][1] >> p[i][2];
}
int _p;
for(int k=0;k<3;k++)
{
for(int i=0;i<n;i++)
{
_p = p[i][k];
for(int j=i+1;j<n;j++)
{
if(_p == p[j][k])
{
p[i][k] = 0;
p[j][k] = 0;
}
}
}
}
for(int i=0;i<n;i++)
{
cout << p[i][0] + p[i][1] + p[i][2] << endl;
}
*/
/*
//得点
int ai,am,as,ae,bi,bm,bs,be;
cin >> ai >> am >> as >> ae >> bi >> bm >> bs >> be;
int answer=ai+am+as+ae;
if(answer < bi+bm+bs+be)
{
answer=bi+bm+bs+be;
}
cout << answer << endl;
*/
//おつり
while(true){
int N;
if(N == 0) break;
int nedan;
cin >> nedan;
int oturi = 1000-nedan;
int onum= 0;
if(oturi >= 500)
{
onum++;
oturi -= 500;
}
while(oturi>=100)
{
onum++;
oturi -= 100;
}
if(oturi >= 50)
{
onum++;
oturi -= 50;
}
while(oturi>=10)
{
onum++;
oturi -= 10;
}
if(oturi >= 5)
{
onum++;
oturi -= 5;
}
while(oturi>=1)
{
onum++;
oturi -= 1;
}
}
return 0;
}
| a.cc:109:9: error: expected unqualified-id before 'for'
109 | for(int i=0;i<n;i++)
| ^~~
a.cc:109:21: error: 'i' does not name a type
109 | for(int i=0;i<n;i++)
| ^
a.cc:109:25: error: 'i' does not name a type
109 | for(int i=0;i<n;i++)
| ^
a.cc:115:9: error: expected unqualified-id before 'for'
115 | for(int k=0;k<3;k++)
| ^~~
a.cc:115:21: error: 'k' does not name a type
115 | for(int k=0;k<3;k++)
| ^
a.cc:115:25: error: 'k' does not name a type
115 | for(int k=0;k<3;k++)
| ^
a.cc:131:9: error: expected unqualified-id before 'for'
131 | for(int i=0;i<n;i++)
| ^~~
a.cc:131:21: error: 'i' does not name a type
131 | for(int i=0;i<n;i++)
| ^
a.cc:131:25: error: 'i' does not name a type
131 | for(int i=0;i<n;i++)
| ^
a.cc:135:10: error: expected unqualified-id before '/' token
135 | */
| ^
a.cc:192:9: error: expected unqualified-id before 'return'
192 | return 0;
| ^~~~~~
a.cc:193:1: error: expected declaration before '}' token
193 | }
| ^
|
s092270966 | p00444 | C++ | #include<iostream>
using namespace std;
int main(){
while(1){
int n;
cin>>n;
if(n==0)break;
int a,b,c,d,e,f,g;
g=1000-n;
for(a=0;a<2;a++){
for(b=0;b<5;b++){
for(c=0;c<2;c++){
for(d=0;d<5;d++){
for(e=0;e<2;e++){
for(f=0;f<5;f++){
if(a*500+b*100+c*50+d*10+e*5+f==g){
cout<<a+b+c+d+e+f<<endl;
break;
}
}
}
}
}
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:27:8: error: expected '}' at end of input
27 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s675250277 | p00444 | C++ | #include<iostream>
using namespase std;
int main(
int n,m;
cin >> n;
n = 1000 - n;
m = 0;
if ( n >= 500) {
m = m + 1;
}
if ( n >= 100) {
m = m + (n / 100);
}
if (n >= 50) {
m = m + (n / 50);
}
if (n >= 10) {
m = m + (n / 10);
}
if (n >= 5) {
m = m + (n / 5);
}
if (n >= 1) {
m = m + (n / 1);
}
cout << m << endl;
return 0;
)
| a.cc:2:7: error: expected nested-name-specifier before 'namespase'
2 | using namespase std;
| ^~~~~~~~~
a.cc:5:15: error: 'm' has not been declared
5 | int n,m;
| ^
a.cc:5:16: error: expected ')' before ';' token
5 | int n,m;
| ^
| )
a.cc:4:9: note: to match this '('
4 | int main(
| ^
a.cc:4:5: warning: second argument of 'int main(int, int)' should be 'char **' [-Wmain]
4 | int main(
| ^~~~
a.cc:6:9: error: 'cin' does not name a type
6 | cin >> n;
| ^~~
a.cc:8:9: error: 'n' does not name a type
8 | n = 1000 - n;
| ^
a.cc:9:9: error: 'm' does not name a type; did you mean 'tm'?
9 | m = 0;
| ^
| tm
a.cc:11:9: error: expected unqualified-id before 'if'
11 | if ( n >= 500) {
| ^~
a.cc:14:9: error: expected unqualified-id before 'if'
14 | if ( n >= 100) {
| ^~
a.cc:17:9: error: expected unqualified-id before 'if'
17 | if (n >= 50) {
| ^~
a.cc:20:9: error: expected unqualified-id before 'if'
20 | if (n >= 10) {
| ^~
a.cc:23:9: error: expected unqualified-id before 'if'
23 | if (n >= 5) {
| ^~
a.cc:26:9: error: expected unqualified-id before 'if'
26 | if (n >= 1) {
| ^~
a.cc:30:9: error: 'cout' does not name a type
30 | cout << m << endl;
| ^~~~
a.cc:32:9: error: expected unqualified-id before 'return'
32 | return 0;
| ^~~~~~
a.cc:33:1: error: expected unqualified-id before ')' token
33 | )
| ^
|
s652629308 | p00444 | C++ | #include<iostream>
#using namespase std;
int main(
int n,m;
cin >> n;
n = 1000 - n;
m = 0;
if ( n >= 500) {
m = m + 1;
}
if ( n >= 100) {
m = m + (n / 100);
}
if (n >= 50) {
m = m + (n / 50);
}
if (n >= 10) {
m = m + (n / 10);
}
if (n >= 5) {
m = m + (n / 5);
}
if (n >= 1) {
m = m + (n / 1);
}
cout << m << endl;
return 0;
)
| a.cc:2:2: error: invalid preprocessing directive #using
2 | #using namespase std;
| ^~~~~
a.cc:5:11: error: 'm' has not been declared
5 | int n,m;
| ^
a.cc:5:12: error: expected ')' before ';' token
5 | int n,m;
| ^
| )
a.cc:4:9: note: to match this '('
4 | int main(
| ^
a.cc:4:5: warning: second argument of 'int main(int, int)' should be 'char **' [-Wmain]
4 | int main(
| ^~~~
a.cc:6:5: error: 'cin' does not name a type
6 | cin >> n;
| ^~~
a.cc:8:5: error: 'n' does not name a type
8 | n = 1000 - n;
| ^
a.cc:9:5: error: 'm' does not name a type; did you mean 'tm'?
9 | m = 0;
| ^
| tm
a.cc:11:5: error: expected unqualified-id before 'if'
11 | if ( n >= 500) {
| ^~
a.cc:14:5: error: expected unqualified-id before 'if'
14 | if ( n >= 100) {
| ^~
a.cc:17:5: error: expected unqualified-id before 'if'
17 | if (n >= 50) {
| ^~
a.cc:20:5: error: expected unqualified-id before 'if'
20 | if (n >= 10) {
| ^~
a.cc:23:5: error: expected unqualified-id before 'if'
23 | if (n >= 5) {
| ^~
a.cc:26:5: error: expected unqualified-id before 'if'
26 | if (n >= 1) {
| ^~
a.cc:30:5: error: 'cout' does not name a type
30 | cout << m << endl;
| ^~~~
a.cc:32:5: error: expected unqualified-id before 'return'
32 | return 0;
| ^~~~~~
a.cc:33:1: error: expected unqualified-id before ')' token
33 | )
| ^
|
s807764623 | p00444 | C++ | #include<iostream>
using namespace std;
int main(
int n,m;
cin >> n;
n = 1000 - n;
m = 0;
if ( n >= 500) {
m = m + 1;
}
if ( n >= 100) {
m = m + (n / 100);
}
if (n >= 50) {
m = m + (n / 50);
}
if (n >= 10) {
m = m + (n / 10);
}
if (n >= 5) {
m = m + (n / 5);
}
if (n >= 1) {
m = m + (n / 1);
}
cout << m << endl;
return 0;
)
| a.cc:5:11: error: 'm' has not been declared
5 | int n,m;
| ^
a.cc:5:12: error: expected ')' before ';' token
5 | int n,m;
| ^
| )
a.cc:4:9: note: to match this '('
4 | int main(
| ^
a.cc:4:5: warning: second argument of 'int main(int, int)' should be 'char **' [-Wmain]
4 | int main(
| ^~~~
a.cc:6:5: error: 'cin' does not name a type
6 | cin >> n;
| ^~~
a.cc:8:5: error: 'n' does not name a type
8 | n = 1000 - n;
| ^
a.cc:9:5: error: 'm' does not name a type; did you mean 'tm'?
9 | m = 0;
| ^
| tm
a.cc:11:5: error: expected unqualified-id before 'if'
11 | if ( n >= 500) {
| ^~
a.cc:14:5: error: expected unqualified-id before 'if'
14 | if ( n >= 100) {
| ^~
a.cc:17:5: error: expected unqualified-id before 'if'
17 | if (n >= 50) {
| ^~
a.cc:20:5: error: expected unqualified-id before 'if'
20 | if (n >= 10) {
| ^~
a.cc:23:5: error: expected unqualified-id before 'if'
23 | if (n >= 5) {
| ^~
a.cc:26:5: error: expected unqualified-id before 'if'
26 | if (n >= 1) {
| ^~
a.cc:30:5: error: 'cout' does not name a type
30 | cout << m << endl;
| ^~~~
a.cc:32:5: error: expected unqualified-id before 'return'
32 | return 0;
| ^~~~~~
a.cc:33:1: error: expected unqualified-id before ')' token
33 | )
| ^
|
s873497156 | p00444 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
/*
//数あて
int n;
cin >> n;
int p[200][3];
for(int i=0;i<n;i++)
{
cin >> p[i][0] >> p[i][1] >> p[i][2];
}
int _p;
for(int k=0;k<3;k++)
{
for(int i=0;i<n;i++)
{
_p = p[i][k];
for(int j=i+1;j<n;j++)
{
if(_p == p[j][k])
{
p[i][k] = 0;
p[j][k] = 0;
}
}
}
}
for(int i=0;i<n;i++)
{
cout << p[i][0] + p[i][1] + p[i][2] << endl;
}
*/
/*
//得点
int ai,am,as,ae,bi,bm,bs,be;
cin >> ai >> am >> as >> ae >> bi >> bm >> bs >> be;
int answer=ai+am+as+ae;
if(answer < bi+bm+bs+be)
{
answer=bi+bm+bs+be;
}
cout << answer << endl;
*/
//おつり
int onum;
int i = 0;
while(true){
int N;
cin >> N;
if(N == 0) break;
int oturi = 1000-N;
if(oturi >= 500)
{
onum++;
oturi -= 500;
}
while(oturi>=100)
{
onum++;
oturi -= 100;
}
if(oturi >= 50)
{
onum++;
oturi -= 50;
}
while(oturi>=10)
{
onum++;
oturi -= 10;
}
if(oturi >= 5)
{
onum++;
oturi -= 5;
}
while(oturi>=1)
{
onum++;
oturi -= 1;
}
i++;
}
cout << onum[0] << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:95:17: error: invalid types 'int[int]' for array subscript
95 | cout << onum[0] << endl;
| ^
|
s128085877 | p00444 | C++ | #include <iostream>
using namespace std;
int main(){
int n,m;
cin >> n;
m = 0;
while( n <= 500 ){
n = n-500;
m++;
}
while( n <= 100 ){
n = n-100;
m++;
}
while( n <= 50 ){
n = n-50;
m++;
}
while( n <= 10 ){
n = n-10;
m++;
}
while( n <= 5 ){
n = n-5;
m++;
}
while( n <= 1){
n = n-1;
m++;
}
cout << m <<cout;
return 0;
}
| a.cc: In function 'int main()':
a.cc:33:19: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and 'std::ostream' {aka 'std::basic_ostream<char>'})
33 | cout << m <<cout;
| ~~~~~~~~~ ^~~~~~
| | |
| | basic_ostream<[...]>
| basic_ostream<[...]>
a.cc:33:19: note: candidate: 'operator<<(int, int)' (built-in)
33 | cout << m <<cout;
| ~~~~~~~~~~^~~~~~
a.cc:33:19: note: no known conversion for argument 2 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candi |
s005917455 | p00444 | C++ | #include<iostream>
using namespace std;
int coin[]={500,100,50,10,5,1};
int main() {int n,r,i;while(1){cin>>n;if(!n)break;n=1000-n,r=0;for(i=0;i<6;i++)r+=n/coin[i],n%=coin[i];cout<<res<<endl;}} | a.cc: In function 'int main()':
a.cc:4:110: error: 'res' was not declared in this scope
4 | int main() {int n,r,i;while(1){cin>>n;if(!n)break;n=1000-n,r=0;for(i=0;i<6;i++)r+=n/coin[i],n%=coin[i];cout<<res<<endl;}}
| ^~~
|
s026339786 | p00444 | C++ | #import<cstdio>
int main(){
int i,n,c[]={0,1,5,10,50,100,500};
for(;*c=0,scanf("%d",&n),n;printf("%d\n",*c)){
for(n=1000-n,i=6;i;i--){
for(;n>=c[i];){
n-=c[i],*c++;
}
}
}
} | a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
1 | #import<cstdio>
| ^~~~~~
a.cc: In function 'int main()':
a.cc:7:42: error: lvalue required as increment operand
7 | n-=c[i],*c++;
| ^
|
s002766987 | p00444 | C++ | #include <iostream>
using namespace std;
int main() {
int value,change;
int coins;
while(1) {
cin >> value;
if(value==0) break;
coins=0;
change=1000-value;
coins+=change/500;
change%=500;
coins+=change/100;
change%=100;
coins+=change/50;
change%=50;
coins+=change/10;
change%=10;
coins+=change/5;
change%=5;
coins+=change/1;
change%=1;
cout << coinsツ << endl;
}
return 0;
} | a.cc:38:13: error: extended character is not valid in an identifier
38 | cout << coinsツ << endl;
| ^
a.cc: In function 'int main()':
a.cc:38:13: error: 'coins\U000030c4\U00003000' was not declared in this scope
38 | cout << coinsツ << endl;
| ^~~~~~~~~
|
s113393741 | p00444 | C++ | g#include <iostream>
using namespace std;
int main() {
int n;
while (cin >> n) {
if (n == 0) break;
int change = 1000 - n;
int count = 0;
if (change >= 500) {
change -= 500;
count++;
}
if (change >= 100) {
int coin_100 = change / 100;
change -= 100 * coin_100;
count += coin_100;
}
if (change >= 50) {
change -= 50;
count++;
}
if (change >= 10) {
int coin_10 = change / 10;
change -= 10 * coin_10;
count += coin_10;
}
if (change >= 5) {
change -= 5;
count++;
}
count += change;
cout << count << endl;
}
return 0;
}
| a.cc:1:2: error: stray '#' in program
1 | g#include <iostream>
| ^
a.cc:1:1: error: 'g' does not name a type
1 | g#include <iostream>
| ^
a.cc: In function 'int main()':
a.cc:7:12: error: 'cin' was not declared in this scope
7 | while (cin >> n) {
| ^~~
a.cc:34:9: error: 'cout' was not declared in this scope; did you mean 'count'?
34 | cout << count << endl;
| ^~~~
| count
a.cc:34:26: error: 'endl' was not declared in this scope
34 | cout << count << endl;
| ^~~~
|
s412598644 | p00444 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int a;
int b;
int c;
while(cin >> a){
if(n!=0){b=1000-a;
c=0;
if(b=>500){b=b-500; c=c+1;}
if(b=>100){while(b<100){b=b-100; c=c+1;}}
if(b=>50){b=b-50; c=c+1;}
if(b=>10){while(b<10){b=b-10; c=c+1;}}
if(b=>5){b=b-5; c=c+1;}
c=b+c;
cout << c<<endl;
}
}
} | a.cc: In function 'int main()':
a.cc:9:4: error: 'n' was not declared in this scope
9 | if(n!=0){b=1000-a;
| ^
a.cc:11:6: error: expected primary-expression before '>' token
11 | if(b=>500){b=b-500; c=c+1;}
| ^
a.cc:12:6: error: expected primary-expression before '>' token
12 | if(b=>100){while(b<100){b=b-100; c=c+1;}}
| ^
a.cc:13:6: error: expected primary-expression before '>' token
13 | if(b=>50){b=b-50; c=c+1;}
| ^
a.cc:14:6: error: expected primary-expression before '>' token
14 | if(b=>10){while(b<10){b=b-10; c=c+1;}}
| ^
a.cc:15:6: error: expected primary-expression before '>' token
15 | if(b=>5){b=b-5; c=c+1;}
| ^
|
s846128315 | p00444 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int a;
int b;
int c;
while(cin >> a){
if(n!=0){b=1000-a;
c=0;
if(b>=500){b=b-500; c=c+1;}
if(b>=100){while(b<100){b=b-100; c=c+1;}}
if(b>=50){b=b-50; c=c+1;}
if(b>=10){while(b<10){b=b-10; c=c+1;}}
if(b>=5){b=b-5; c=c+1;}
c=b+c;
cout << c<<endl;
}
}
} | a.cc: In function 'int main()':
a.cc:9:4: error: 'n' was not declared in this scope
9 | if(n!=0){b=1000-a;
| ^
|
s395021391 | p00444 | C++ | #include <cstdio>
using namespace std;
int main()
{
while(true) {
int n;
scanf("%d", &n);
if(n == 0)
break;
int change = 1000 - n;
int ans = 0;
for(int digit = 1; digit < 1000; mul *= 10) {
int cur = change / digit % 10;
ans += (cur / 5) + (cur % 5);
}
printf("%d\n", ans);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:13:34: error: 'mul' was not declared in this scope
13 | for(int digit = 1; digit < 1000; mul *= 10) {
| ^~~
|
s475137810 | p00444 | C++ | #include <cstdio>
int main (int argc, char const* argv[])
{
int coin[6]={500,100,50,10,5,1};
int a,r=0,m;
while(true){
scanf("%d",&m);
if(m==0) break;
m=1000-m;
r=0
for(int i=0;i<6;i++){
a=m/coin[i];
r+=a;
m-=(a*coin[i]);
}
printf("%d\n",r);
}
return 0;
} | a.cc: In function 'int main(int, const char**)':
a.cc:15:12: error: expected ';' before 'for'
15 | r=0
| ^
| ;
16 | for(int i=0;i<6;i++){
| ~~~
a.cc:16:21: error: 'i' was not declared in this scope
16 | for(int i=0;i<6;i++){
| ^
|
s610395144 | p00444 | C++ | #include<iostream>
using namespace std;
int p[6] = {500, 100, 50, 10, 5, 1};
int main(){
int n;
while(cin >> n, n){
ans = 0;
n = 1000 - n;
for(int i=0; i < 6; i++){
ans += n / p[i];
n -= n / p[i] * p[i];
}
cout << ans << endl;
}
} | a.cc: In function 'int main()':
a.cc:9:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
9 | ans = 0;
| ^~~
| abs
|
s480412804 | p00444 | C++ | coin = [500,100,50,10,5,1]
loop do
n = gets.chomp.to_i
break if n==0
n=1000-n
ans = 0
for c in coin
ans+=n/c
n=n%c
end
puts ans
end | a.cc:1:1: error: 'coin' does not name a type
1 | coin = [500,100,50,10,5,1]
| ^~~~
|
s823603320 | p00444 | C++ | #include<stdio.h>
int mian(void){
int n,k;
while(0==0){
scanf("%d",&n);
if(n==0)break;
k=0;
k += n /500; n %=500;
k += n/100; n %=100;
k += n/50; n %= 50;
k += n/10; n %= 10;
k += n/5; k += n%5;
printf("%d\n",k);
}
return 0;
} | /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
|
s854315084 | p00444 | C++ | #include<stdio.h>
int mian(void){
int n,k;
while(0==0){
scanf("%d",&n);
if(n==0)break;
k=0;
k += n /500; n %=500;
k += n/100; n %=100;
k += n/50; n %= 50;
k += n/10; n %= 10;
k += n/5; k += n%5;
printf("%d\n",k);
}
return 0;
} | /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
|
s105598559 | p00445 | C | #include<stdio.h>
#include<string.h>
#include<windows.h>
int main(){
int cnt=0,cut=0,i,f;
char a[1001];
scanf("%s",a);
f=strlen(a);
for(i=0;i<f;i++){
if(a[i]=='J' && a[i+1]=='O' && a[i+2]=='I')cnt+=1;
if(a[i]=='I' && a[i+1]=='O' && a[i+2]=='I')cut+=1;
}
printf("%d\n%d\n",cnt,cut);
return 0;
}
| main.c:3:9: fatal error: windows.h: No such file or directory
3 | #include<windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s920389896 | p00445 | C | #include<stdio.h>
int main(void){
while(scanf("%s",moji)!=EOF){
int a=0,b=0,i=0;
char moji[10000];
while(moji[i+2]!='\0'){
if(moji[i]=='J' && moji[i+1]=='O' && moji[i+2]=='I')a++;
else if(moji[i]=='I' && moji[i+1]=='O' && moji[i+2]=='I')b++;
i++;
}
printf("%d\n%d\n",a,b);
}
return 0;
}
| main.c: In function 'main':
main.c:3:26: error: 'moji' undeclared (first use in this function)
3 | while(scanf("%s",moji)!=EOF){
| ^~~~
main.c:3:26: note: each undeclared identifier is reported only once for each function it appears in
|
s056698534 | p00445 | C |
#include <string.h>
int main(void)
{
char str[100000];
int i, j;
int jcnt, icnt;
char str1[4];
while (scanf("%s", str) != EOF){
jcnt = 0;
for (i = 0; i < strlen(str) - 2; i++){
if (str[i] == 'J' && str[i + 1] == 'O' && str[i + 2] == 'I'){
jcnt++;
}
}
icnt = 0;
for (i = 0; i < strlen(str) - 2; i++){
if (str[i] == 'I' && str[i + 1] == 'O' && str[i + 2] == 'I'){
icnt++;
}
}
}
printf("%d\n", jcnt);
printf("%d\n", icnt);
return (0);
}
| main.c: In function 'main':
main.c:11:16: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
11 | while (scanf("%s", str) != EOF){
| ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
2 | #include <string.h>
+++ |+#include <stdio.h>
3 |
main.c:11:16: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
11 | while (scanf("%s", str) != EOF){
| ^~~~~
main.c:11:16: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:11:36: error: 'EOF' undeclared (first use in this function)
11 | while (scanf("%s", str) != EOF){
| ^~~
main.c:11:36: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:11:36: note: each undeclared identifier is reported only once for each function it appears in
main.c:32:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
32 | printf("%d\n", jcnt);
| ^~~~~~
main.c:32:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:32:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:32:9: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s043865301 | p00445 | C | #include<stdio.h>
int main(void){
inj++;int counti,countj;
char a[10000];
while(scanf("%s",a)!=EOF){
counti=0;
countj=0;
for(i=0;a[i]!='\0';i++){
if(a[i+1]=='O'&&a[i+2]=='I'){
if(a[i]=='I')counti++;
if(a[i]=='J')countj++;
}
}
printf("%d\n%d\n",counti,countj);
}
return 0;} | main.c: In function 'main':
main.c:3:1: error: 'inj' undeclared (first use in this function); did you mean 'int'?
3 | inj++;int counti,countj;
| ^~~
| int
main.c:3:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:5: error: 'i' undeclared (first use in this function)
9 | for(i=0;a[i]!='\0';i++){
| ^
|
s992311126 | p00445 | C | #include<stdio.h>
int main(void){
int counti,countj;
char a[10000];
while(scanf("%s",a)!=EOF){
counti=0;
countj=0;
for(i=0;a[i]!='\0';i++){
if(a[i+1]=='O'&&a[i+2]=='I'){
if(a[i]=='I')counti++;
if(a[i]=='J')countj++;
}
}
printf("%d\n%d\n",counti,countj);
}
return 0;} | main.c: In function 'main':
main.c:9:5: error: 'i' undeclared (first use in this function)
9 | for(i=0;a[i]!='\0';i++){
| ^
main.c:9:5: note: each undeclared identifier is reported only once for each function it appears in
|
s916631847 | p00445 | C | int main(void) {
int i,joi,ioi = 0;
char s[11000];
while (scanf("%s",s) != EOF){
joi = 0;
ioi = 0;
for(i = 0;i <= 10997;i++){
if(s[i] == 'J' && s[i + 1] == 'O' && s[i + 2] == 'I'){
joi++;
}
if(s[i] == 'I' && s[i + 1] == 'O' && s[i + 2] == 'I'){
ioi++;
}
}
printf("%d\n%d\n",joi,ioi);
for (i = 0;i <= 10999;i++){
s[i] = '0';
}
}
return 0;
} | main.c: In function 'main':
main.c:4:16: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
4 | while (scanf("%s",s) != EOF){
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int main(void) {
main.c:4:16: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
4 | while (scanf("%s",s) != EOF){
| ^~~~~
main.c:4:16: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:33: error: 'EOF' undeclared (first use in this function)
4 | while (scanf("%s",s) != EOF){
| ^~~
main.c:4:33: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:4:33: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
15 | printf("%d\n%d\n",joi,ioi);
| ^~~~~~
main.c:15:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:15:17: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s845958479 | p00445 | C | #include<stdio.h>
int main(){
char ch[100001];
int i=0,joi=0,ioi=0;
while(1){
scanf("%s",&ch);
if(ch[0]=='')break;
for(i=0;;i++){
if(ch[i]==EOF)break;
if(ch[i]=='J' && ch[i+1]=='O' && ch[i+2]=='I'){
joi++;
}
if(ch[i]=='I' && ch[i+1]=='O' && ch[i+2]=='I'){
ioi++;
}
}
printf("%d\n%d\n",joi,ioi);
}
return 0;
} | main.c: In function 'main':
main.c:7:11: error: empty character constant
7 | if(ch[0]=='')break;
| ^~
|
s143695552 | p00445 | C | #include <iostream>
#include <map>
#include <algorithm>
using namespace std;
const int N = 80;
int ans[N] = { 0 };
int damari[N] = { 0 };
map<int, bool> amari;
int main(){
int p, q, r, c, i;
bool loop;
while(cin >> p >> q){
loop = false;
p *= 10;
for(i = 0;i < N;++i){
c = 0;
while(p >= q){
p -= q;
++c;
}
ans[i] = c;
if(p == 0) break;
damari[i] = p;
if(amari[p]){
loop = true;
break;
}
else{
amari[p] = true;
}
p *= 10;
}
for(int j = 0;j < i + 1;++j){
cout << ans[j];
}
cout << endl;
// ハット処理
if(loop){
bool hflag = false;
for(int j = 0;j <= i;++j){
if(hflag){
cout << "^";
}
else{
if(damari[j] == damari[i]){
hflag = true;
}
cout << " ";
}
}
cout << endl;
}
amari.clear();
}
return 0;
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s046391995 | p00445 | C | #include <stdio.h>
int main(void)
{
char a[10001]={};
while(scanf("%s",a)!=EOF){
int j=0,i=0;
int n;
l=strlen(a);
for(n=0;n<l-2;n++){
if(a[n]=='J'&&a[n+1]=='O'&&a[n+2]=='I')
j++;
if(a[n]=='I'&&a[n+1]=='O'&&a[n+2]=='I')
i++;
}
printf("%d\n%d\n",j,i);
}
return 0;
} | main.c: In function 'main':
main.c:9:5: error: 'l' undeclared (first use in this function)
9 | l=strlen(a);
| ^
main.c:9:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:7: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
9 | l=strlen(a);
| ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
1 | #include <stdio.h>
+++ |+#include <string.h>
2 |
main.c:9:7: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
9 | l=strlen(a);
| ^~~~~~
main.c:9:7: note: include '<string.h>' or provide a declaration of 'strlen'
|
s752871842 | p00445 | C | #include <stdio.h>
#include <string.h>
int main(void)
{
char a[10001]={};
while(scanf("%s",a)!=EOF){
int j=0,i=0;
int n;
l=strlen(a);
for(n=0;n<l-2;n++){
if(a[n]=='J'&&a[n+1]=='O'&&a[n+2]=='I')
j++;
if(a[n]=='I'&&a[n+1]=='O'&&a[n+2]=='I')
i++;
}
printf("%d\n%d\n",j,i);
}
return 0;
} | main.c: In function 'main':
main.c:9:5: error: 'l' undeclared (first use in this function)
9 | l=strlen(a);
| ^
main.c:9:5: note: each undeclared identifier is reported only once for each function it appears in
|
s907546640 | p00445 | C | #include <stdio.h>
int main()
{
char str[10001];
int i = 0, j = 0, a;
while (scanf_s("%s", str) == 1) {
for (a = 0;str[a] != '\0';a++) {
if (str[a] == 'J'&&str[a + 1] == 'O'&&str[a + 2] == 'I')
i++;
}
for (a = 0;str[a] != '\0';a++) {
if (str[a] == 'I'&&str[a + 1] == 'O'&&str[a + 2] == 'I')
j++;
}
printf("%d\n %d\n", i, j);
}
return 0;
} | main.c: In function 'main':
main.c:7:24: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
7 | while (scanf_s("%s", str) == 1) {
| ^~~~~~~
| scanf
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.