Last active
May 26, 2023 21:45
-
-
Save eugrus/d517055033aae52670c222c536e0c003 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> | |
int main() { | |
int count = 0; | |
while (1) { | |
printf("fast\n"); | |
if (count == 49) { | |
count = 0; | |
printf("slow\n"); | |
} | |
count++; | |
} | |
return 0; | |
} |
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
count = 0 | |
while True: | |
print("fast") | |
if count == 49: | |
count = 0 | |
print("slow") | |
count += 1 |
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
#!/bin/bash | |
count=0 | |
while true; do | |
echo "fast" | |
if (( count == 49 )); then | |
count=0 | |
echo "slow" | |
fi | |
count=$(( count + 1 )) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment