Created
April 9, 2018 10:30
-
-
Save neko314/727f082bec061aed3ae7aecc4dbc93c6 to your computer and use it in GitHub Desktop.
Rakefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
CC = "gcc" | |
desc "the sum from 1 to 100" | |
task :default => "sum" | |
file "sum" => "sum.o" do | |
sh "#{CC} -o sum sum.o" | |
end | |
file "sum.o" => "sum.c" do | |
sh "#{CC} -c sum.c" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ©佐伯英子 http://saeki-ce.xsrv.jp/Cgengo.html | |
/********************/ | |
/* 総和を計算する */ | |
/********************/ | |
#include <stdio.h> | |
int main( ) | |
{ | |
int sum=0,i=1; | |
while( i<=100 ) | |
{ | |
sum+=i; | |
i++; | |
} | |
printf("\n1 から 100 までの総和は %d です\n",sum); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment