首页 > 其他分享 >实验二

实验二

时间:2023-03-16 17:45:42浏览次数:28  
标签:lf int scanf number 实验 printf include

任务一

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define N 5
#define R1 586
#define R2 701
int main()
{
int number;
int i;
srand( time(0) ); 
for(i = 0; i < N; ++i)
{
    number = rand() % (R2 - R1 + 1) + R1;
printf("20228330%04d\n", number);
} 
return 0;
}

18行在计算输出number的值

任务二

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

任务三

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

 

标签:lf,int,scanf,number,实验,printf,include
From: https://www.cnblogs.com/gixing/p/17223520.html

相关文章

  • 实验2
    #include<stdio.h>#include<stdlib.h>#include<time.h>#defineN5#defineR1586#defineR2701intmain(){intnumber;inti;sr......
  • 网络对抗实验一 逆向及Bof基础实践--20201313
    目录1逆向及Bof基础实践说明1.1实验内容1.2基础知识1.2.1NOP,JNE,JE,JMP,CMP汇编指令的机器码:1.2.2掌握反汇编与十六进制编程器2直接修改程序机器指令,改变程序......
  • lab1实验报告
    lab1实验报告一、实验思考题Thinking1.1运行readelf工具readelf-hvmlinux运行自己编写的readelf./readelfvmlinux注意到Data中显示为bigendian,而当前我们完成......
  • 火山引擎 DataTester:A/B 实验如何应用在抖音的产品优化流程中?
    更多技术交流、求职机会,欢迎关注字节跳动数据平台微信公众号,回复【1】进入官方交流群 日前,在WOT全球创新技术大会上,火山引擎DataTester技术负责人韩云飞做了关于字......
  • 易基因:高通量测序后的下游实验验证方法——ChIP-seq篇|干货系列
    大家好,这里是专注表观组学十余年,领跑多组学科研服务的易基因。此前,我们分享了染色质免疫共沉淀测序(ChIP-seq)的数据挖掘思路,进而筛选出TF结合/组蛋白修饰的目标区域和候选......
  • 实验1
    实验任务1实验源码:1#task12print('hey,u')34print('hey','u')56x,y,z=1,2,37print(x,y,z)89print('x=%d,y=%d,z=%d'%(x,y,z))10print('x......
  • 实验一
    实验任务1源代码#print输出的几种用法#用法1:用于输出单个字符串或单个变量print('hey,u')#用法2:用于输出多个数据项,用逗号分隔print('hey','u')x,y,z=1,2,3prin......
  • 实验1
    print('hey,u')print('hey','u')x,y,z=1,2,3print(x,y,z)print('x=%d,y=%d,z=%d'%(x,y,z))print('x={},y={},z={}'.format(x,y,z))print(f'x={x},y={y},z={z}')......
  • 实验一
    实验任务1test1_1.py1#print输出的几种用法23#用法1:用于输出单个字符串或单个变量4print('hey,u')56#用法2:用于输出多个数据项,用逗号分隔7print(......
  • 触摸驱动实验
    学习地址触摸校准实验......