实验1

/* A simple program */
#include <stdio.h>
int main() {
    
printf("My stuno is 202083450033\n2020, do you fine");

return 0;
}

/*循环打印字符*/
#include <stdio.h>
int main() {
    while(1)
         printf("0 0");
         
    return 0;     
} 

#include <stdio.h>
int main () {
    
    float x, y;
    float r1, r2, r3, r4;
    
    x = 1;
    y = 2;
    
    r1 = x + y;
    r2 = x - y;
    r3 = x * y;
    r4 = x / y;
    
    printf("r1 = %d\n", r1);
    printf("r2 = %d\n", r2);
    printf("r3 = %d\n", r3);
    printf("r4 = %d\n", r4);
    
    return 0;
}

#include <stdio.h>
int main() {
    int answer;
    char words[5000];
    
    printf("在家学习让人喜或忧.\n");
    printf("1.作为一个宅,it's good, self-study is ok.\n");
    printf("2.not good, I am blind.\n");
    printf("3.middle, can't say it well.\n");
    printf("4.others...\n");
    printf("your choice:  ");
    scanf("%d", &answer);
    if(answer == 4){
        printf("add your idea: \n");
        getchar();
        gets(words); 
    } 
    
    printf("\n");
    printf("when encounter difficult,which you will choose:\n");
    printf("1.solve it onr by one.\n");
    printf("2.unhappy and do nothing.\n");
    printf("3.others...\n");
    printf("your choice;  ");
    scanf("%d", &answer);
    
    if (answer == 1)
         printf(":)\n");
    else if(answer == 2)
         printf("it's wrong, let's choose 1\n");
    else if(answer == 3) {
        printf("add your idea:  \n");
        getchar ();
        gets(words);
    } 
    
    return 0;
}

posted @ 2020-10-17 21:20  赖梓贤  阅读(67)  评论(0编辑  收藏  举报