Skip to content

Instantly share code, notes, and snippets.

@eugrus
Last active May 26, 2023 21:45
Show Gist options
  • Save eugrus/d517055033aae52670c222c536e0c003 to your computer and use it in GitHub Desktop.
Save eugrus/d517055033aae52670c222c536e0c003 to your computer and use it in GitHub Desktop.
цикл с быстрой и медленной частями тела
#include <stdio.h>
int main() {
int count = 0;
while (1) {
printf("fast\n");
if (count == 49) {
count = 0;
printf("slow\n");
}
count++;
}
return 0;
}
count = 0
while True:
print("fast")
if count == 49:
count = 0
print("slow")
count += 1
#!/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