[ create a new paste ] login | about

Link: http://codepad.org/PMI5NgFp    [ raw code | output | fork ]

C, pasted on Sep 24:
#include<stdio.h>

int sum(int,int);

int main (void)
{
    printf("name\t:bibun\n");
    printf("favorite food\t:fried rice\n");
    printf("%d\n",(100*31)+2);

//suutiの値//
    int suuti;
    scanf("%d\n",&suuti);
    if(suuti==1){
        printf("no1\n");
    }else if(suuti==2){
        printf("no2\n");
    }else{
        printf("その番号は存在しません\n");
    }

//noの値 //
    int no;
    scanf("%d\n",&no);
    switch(no){
    case1:
        printf("no1\n");
        break;
    case2:
        printf("no2\n");
        break;
    case3:
        printf("no3\n");
        break;
    default:
        printf("その番号は存在しません\n");
    }

//iの繰り返し文//
   

    int i;
    for(i=1;i<=10;i++){
        printf("レッツ、コンパス\n");
        if(i==3)break;
    }
    
//while文の繰り返し//
    printf("おこづかいを1円から始めて毎月二倍づつ増えると...\n");

    int money = 1;
    int month = 1;
    
    while(money<1000000){
    printf("%02d月目:%7.0d円\n",month,money);
    money *= 2;
    month ++;
    }
    printf("%d月目に%7.0d円となり、100万円を超える\n",month,money);

//sum文を持ってくる//
    sum(100,74) 

    return 0;
}

int sum(int max,int min)
{

    int num
    num=(max+min)*2-min+3;
    return num;   

return 0;
}


Output:
1
2
3
4
5
6
7
In function 'main':
Line 64: error: expected ';' before 'return'
In function 'sum':
Line 71: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'num'
Line 71: error: 'num' undeclared (first use in this function)
Line 71: error: (Each undeclared identifier is reported only once
Line 71: error: for each function it appears in.)


Create a new paste based on this one


Comments: