C/C++の宿題を片付け ..
[
2ch
|
▼Menu
]
■コピペモード
□
スレを通常表示
□
オプションモード
□このスレッドのURL
■項目テキスト
392:デフォルトの名無しさん 07/09/27 00:00:13 夏休みの宿題を今からかよって感じだな 393:デフォルトの名無しさん 07/09/27 00:05:45 int myatoi(const char *cs) { int a = 1, b = 0; const char *c = cs; if (*c == '-') { a *= -1; c++; } for (; *c != '\0'; c++) { if (*c >= '0' && *c <= '9') b = (b * 10) + *c - '0'; else break; } return a * b; } 394:デフォルトの名無しさん 07/09/27 00:07:06 >>391 #include<string.h> #include<iostream> using namespace std; int main(){ char s[]="ABCDEFGHIJKLMN"; int size = strlen(s); char*end = s + size; int shift; while(cout << "どれだけシフトしますか--> ",cin>>shift){ shift %= size; if(shift < 0)shift += size; rotate(s,end-shift,end); cout << s << endl; } cout<<endl; }
次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
レスジャンプ
mixiチェック!
Twitterに投稿
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch
5297日前に更新/230 KB
担当:undef