Skip to content

Instantly share code, notes, and snippets.

@abcsharp
Forked from KOBA789/buggy_code.cpp
Created June 30, 2011 11:44
Show Gist options
  • Save abcsharp/1056070 to your computer and use it in GitHub Desktop.
Save abcsharp/1056070 to your computer and use it in GitHub Desktop.
情報の授業でやったbuggyな練習問題を仕様通りに動作させてみた
#include <iostream>
using std::cout;
using std::cin;
int main(void)
{
int time;
cin>>time;
if(time>=0&&time<24){
if(t<=11) cout<<"おはよう";
else if(t==12) cout<<"正午";
else if(t<=17) cout<<"こんにちワン";
else if(t<=23) cout<<"こんばんは";
}else cout<<"範囲外";
return 0;
}
@KOBA789
Copy link

KOBA789 commented Jun 30, 2011

/*(1)*/の部分以外は書き換えられないんだぜ?
なにしろペーパーテストの穴埋めだからな……

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment