#include<stdio.h>
#include<stdlib.h>

int main()
{
    printf("  O      O \n");
    printf(" <H>    <H> \n");
    printf(" I I   

 

 I I \n");

    system("pause");

    return 0;
}

task1-3.c

#include<stdio.h>
#include<stdlib.h>

int main()
{
	printf(" O   \n");
	printf("<H>  \n");
	printf("I I  \n");
	printf(" O   \n");
	printf("<H>  \n");
	printf("I I  \n");


	system("pause");

	return 0;
}

  

实验任务2

#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
	double x, ans;
	while (scanf_s("%lf", &x) != EOF)
	{
		ans = pow(x, 365);
		printf("%.2f的365次方:%.2f\n", x, ans);
		printf("\n");
	}
	system("pause");
	return 0;

}

 

 

#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
    double c, f;
    while(scanf_s("%lf", &c)  !=EOF)
    {
        f = 9 * c / 5 + 32;
        printf("摄氏度c=%.2f时,华氏度=%.2f", c, f);
        printf("\n");

    
    }
    system("pause");
    return 0;

}

实验任务3

#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
    int a1, n, q;
    double sum;
    a1 = 1;
    q = 2;
    n = 32;

    sum = a1 * (1 - pow(q, n)) / (1 - q);
    printf("n=%d,sum=%.lf",n, sum);

    system("pause");
    return 0;

}

 

实验任务4

 

#include<stdio.h>
#include<stdlib.h>
int main()
{
    double x, y;
    char c1, c2, c3;
    int a1, a2, a3;
    scanf("%d%d%d",&a1,&a2,&a3);
    printf("%d,%d,%d\n", a1, a2, a3);
    getchar();
    scanf("%c%c%c", &c1, &c2, &c3);
    printf("%c%c%c\n", c1, c2, c3);
    getchar();

    scanf("%lf,%lf", &x, &y);
    printf("%lf,%lf\n", x, y);

    system("pause");
    return 0;

}

实验任务5

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int age1,age2;
    char gender1,gender2;
    
    scanf("%d%c%d%c",&age1,&gender1,&age2,&gender2);
    printf("age1=%d,gender1=%c\n",age1,gender1);
    printf("age2=%d,gender2=%c\n",age2,gender2);
    


    system("pause");
    return 0;

}

实验任务6

#include<stdio.h>
#include<stdlib.h>
int main()
{
    char ans1, ans2;

    printf("每次课前认真复习,课后及时复习了没?(输入Y或y表示有,输入N或n表示没有):");
        ans1 = getchar();
    getchar();
    printf("\n动手敲代码实践了没?(输入Y和y表示敲了,输入n和N表示木有敲):");
        ans2 = getchar();

    if ((ans1 == 'Y' || ans1 =='y') && (ans2 == 'Y' || ans2 =='y'))
        printf("\n罗马不是一天建成的,继续保持哦:)\n");
    else
        printf("\n罗马不是一天毁灭的,我们来建设吧\n");




    system("pause");
    return 0;

}

 实验任务7

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int answer;
    char words[5000];

    printf("网课学习让一些人欢喜一些人忧.\n");
    printf("1.作为喜欢学习且自律的人,觉得这样很好,有网络,自主学习,很ok.\n");
    printf("2.不喜,不喜,很不喜。眼睛快瞎了,脑壳有点卡...\n");
    printf("3.中间派。不知道。说不清。\n");
    printf("4.其它...\n");
    printf("你的选择:");
    scanf_s("%d",&answer);

    if (answer == 4)
    {
        printf("请补充说明你的想法:\n");
        getchar();
        gets(words);

    }
    printf("\n");

    printf("当遇到问题时,你会选择:\n");
    printf("1.遇到问题,就解决问题。不懂的,搜索式学习。逐个攻破。\n");
    printf("2.遇到问题,不高兴,然后,...,没有了.\n");
    printf("3.其它...\n");
    printf("你的选择:");
    scanf_s("%d", &answer);

    if (answer == 1)
        printf(":)\n");
    else if (answer == 2)
        printf("这样不能解决问题啊...我们选择1好不好:)\n");
    else if (answer == 3)
    {
        printf("请补充说明你的想法:\n");
        getchar();
        gets(words);
    }


    system("pause");
    return 0;

}

 

 

 

 

 

原文地址:http://www.cnblogs.com/lqq0727/p/16788138.html

1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长! 2. 分享目的仅供大家学习和交流,请务用于商业用途! 3. 如果你也有好源码或者教程,可以到用户中心发布,分享有积分奖励和额外收入! 4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解! 5. 如有链接无法下载、失效或广告,请联系管理员处理! 6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需! 7. 如遇到加密压缩包,默认解压密码为"gltf",如遇到无法解压的请联系管理员! 8. 因为资源和程序源码均为可复制品,所以不支持任何理由的退款兑现,请斟酌后支付下载 声明:如果标题没有注明"已测试"或者"测试可用"等字样的资源源码均未经过站长测试.特别注意没有标注的源码不保证任何可用性