Wpis z mikrobloga

Żeby wypróbować ChatGPT, poprosiłem automat o napisanie programu "99 bottles of beer".

c
#include <stdio.h>

int main() {
for (int i = 99; i > 0; i--) {
printf("%d bottles of beer on the wall, %d bottles of beer.\n", i, i);
printf("Take one down, pass it around, %d bottles of beer on the wall.\n\n", i - 1);
}
return 0;
}

Po równo 10 poprawkach uzyskałem zadowalającą odpowiedź, co jak na AI oceniam całkiem dobrze:

c
#include <stdio.h>

int main() {
int i = 99;
while (i)
printf("%d bottles of beer on the wall, %d bottles of beer.\n"
"Take one down, pass it around, %d bottles of beer on the wall.\n\n", i, i, --i);
puts("No more bottles of beer on the wall, no more bottles of beer.\n"
"Go to the store and buy some more, 99 bottles of beer on the wall.");
return 0;
}
  • Odpowiedz