#include<stdio.h>
#include<stdlib.h>
//#include<windows.h>
int main() {
int i, j;
int x = 5, y = 10;
for (i = 0; i < x;i++) {
printf("\n");
}
for (j = 0; j < y; j++) {
printf(" ");
}printf("o");
printf("\n");
return 0;
}
1.1.2小球下落
#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
int main() {
int i, j;
int x = 1, y = 10;
for (x = 1; x < 10;x++) {
system("cls");
for (i = 0; i < x; i++) {
printf("\n");
}
for (j = 0; j < y; j++) {
printf(" ");
}printf("o");
Sleep(50);
printf("\n");
}
return 0;
}
1.1.3上下弹跳的小球
#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
int main() {
int i, j;
int x = 5, y = 10;
int height = 20;
int velocity = 1;
while (1) {
x = x + velocity;
if (x >= height || x <= 0) {
velocity = -velocity;
}
system("cls");
for (i = 0; i < x; i++)