[ create a new paste ] login | about

Link: http://codepad.org/bYD5nb5k    [ 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:
name	:bibun
favorite food	:fried rice
3102
その番号は存在しません
その番号は存在しません
レッツ、コンパス
レッツ、コンパス
レッツ、コンパス
おこづかいを1円から始めて毎月二倍づつ増えると...
01月目:      1円
02月目:      2円
03月目:      4円
04月目:      8円
05月目:     16円
06月目:     32円
07月目:     64円
08月目:    128円
09月目:    256円
10月目:    512円
11月目:   1024円
12月目:   2048円
13月目:   4096円
14月目:   8192円
15月目:  16384円
16月目:  32768円
17月目:  65536円
18月目: 131072円
19月目: 262144円
20月目: 524288円
21月目に1048576円となり、100万円を超える


Create a new paste based on this one


Comments: