view src/test/Cudasample_cpu.cu @ 358:98c6e13d8ec7

add sort.cbc
author Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
date Sat, 24 Jun 2017 20:07:27 +0900
parents 2b41bd298fe8
children
line wrap: on
line source

#include <stdio.h>

int main(void)
{       
        int b;
      
        for (b = 99; b >= 0; b--) {
                switch (b) {
                case 0:
                        printf("No more bottles of beer on the wall, no more bottles of beer.\n");
                        printf("Go to the store and buy some more, 99 bottles of beer on the wall.\n");
                        break;
                case 1:
                        printf("1 bottle of beer on the wall, 1 bottle of beer.\n");
                        printf("Take one down and pass it around, no more bottles of beer on the wall\n");
                        break;
                default:
                        printf("%d bottles of beer on the wall, %d bottles of beer.\n", b, b);
                        printf("Take one down and pass it around, %d %s of beer on the wall.\n"
                                ,b - 1
                                ,((b - 1) > 1)? "bottles" : "bottle");
                        break;
                }
        }               
        return 0;
}