2023.8.10 复习(2.11)+练习(2.12)

4.

#include <stdio.h>
int main(void)
{
    int s;
    s=52;
    printf("there are %d weeks in a year.\n",s);
    return 0;
}

7.

#include <stdio.h>
int main ()
{
    int words,lines;
    words=3020;
    lines=350;
    printf("There were %d words and %d lines.\n",words,lines);
    return 0;
}

1.

#include  <stdio.h>
#define LEN 10
char a[LEN]="Viona";
char b[LEN]="Lovegood";
int main()
{
    printf("%s %s\n",a,b);
    printf("%s\n%s\n",a,b);
    printf("%s %s\n",a,b);
    
    return 0;
}

3.

#include  <stdio.h>
int main()
{
    int years,days;
    years=20;
    days=years*365;
    printf("You have lived for %d days.\n",days);
    return 0;
}

4.【自定义函数】

#include<stdio.h>
void jolly();
void deny();
int main()             
{
	jolly();           
	jolly();
	jolly();
	deny();
	return 0;
}
void jolly()
{
	printf("For he's a jolly good fellow!\n");
}
void deny()
{
	printf("Which nobody can deny!\n");
}

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值