Last active
September 6, 2022 16:23
-
-
Save gretchi/ffa63b5ea3089ad42da77b5620bc07e1 to your computer and use it in GitHub Desktop.
ドドスコード
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
#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"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
【問題】配列{"ドド","スコ"}からランダムに要素を標準出力し続け、『その並びが「ドドスコスコスコ」を3回繰り返したもの』に一致したときに「ラブ注入♡」と標準出力して終了するプログラムを作成せよ(配点:5点)
Sheeeeepla さんのツイート