Skip to content

Instantly share code, notes, and snippets.

@gretchi
Last active September 6, 2022 16:23
Show Gist options
  • Save gretchi/ffa63b5ea3089ad42da77b5620bc07e1 to your computer and use it in GitHub Desktop.
Save gretchi/ffa63b5ea3089ad42da77b5620bc07e1 to your computer and use it in GitHub Desktop.
ドドスコード
#include <stdio.h>
#include <stdlib.h>
char *ddsk[2] = {"ドド", "スコ"};
uint16_t history = 0xFFFF;
int main() {
srand(ddsk);
while ((history & 0x0FFF) != 0x0777) {
history = (history << 1) + rand() % 2;
printf("%s", ddsk[history & 0b1]);
}
printf("ラブ注入♡\n");
}
@gretchi
Copy link
Author

gretchi commented Sep 6, 2022

【問題】配列{"ドド","スコ"}からランダムに要素を標準出力し続け、『その並びが「ドドスコスコスコ」を3回繰り返したもの』に一致したときに「ラブ注入♡」と標準出力して終了するプログラムを作成せよ(配点:5点)
Sheeeeepla さんのツイート

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