C言語

C言語 拡張表記 01 \b

・\b カーソルを1つ手前に戻す。--------- 例: #include <stdio.h> #include <stdio.h> #include <time.h> /*--- 一定時間の処理停止 ---*/int sleep(unsigned long x) { clock_t c1 = clock(), c2; /*--- clock型 オブジェクト ---*/ do { /*--- エラー処理 ---*/ if *1 == (clock_t</time.h></stdio.h></stdio.h>…

C言語 勝手に学び舎 開校 第2回 なんと・・・・ おみくじ ^-^  です。

開発環境 Windows用 C言語ツールWindows用 C言語ツール ダウンロード ↓ https://forest.watch.impress.co.jp/library/software/gakucgengo/ Mac: C言語コンパイル方法(X-code)グーグルで 「x-code C言語 コンパイル方法」と検索すると出てきます。 /*----…

C言語 \b \r

・\b 表示位置が、その行内での直前の位置に移動する。 ・\r 現在位置が、その行の先頭に移動する /*--- xミリ秒経過するのを待つ ----*/ int Sleep(unsigned long x) { clock_t c1 = clock(), c2; do { if*1 == (clock_t)-1) /* エラー */ return(0); } whi…

せんだみつを C言語 メモ

#include <stdio.h> #include <time.h> #include <stdlib.h> int main(void) { int human; /* 人間の手 */ int comp; /* コンピュータの手 */ int judge; /* 勝敗 */ int retry; /* リトライ? */ srand(time(NULL)); printf("せんだみつおゲーム!\n"); do { comp = rand() % 3; /* コン</stdlib.h></time.h></stdio.h>…

C言語 clock ゲーム

#include <time.h> #include <stdio.h> #include <stdlib.h> int main(void) { // insert code here... int a,b,c; int x; clock_t start, end; double req_time; srand(time(NULL)); a = 100 + rand() % 900; b = 100 + rand() % 900; c = 100 + rand() % 900; printf("%d + %d + %dは</stdlib.h></stdio.h></time.h>…

C言語 数字当てゲーム do wihle 入力履歴表示

#include <time.h> #include <stdio.h> #include <stdlib.h> #define MAX_STAGE 10 /*最大入力回数 */ int main(void) { int i; int stage; int no; int ans; int num[MAX_STAGE]; srand(time(NULL)); ans = rand() % 1000; printf("0~999の整数を当ててください"); stage = 0; do{ prin</stdlib.h></stdio.h></time.h>…