问答题

在屏幕上显示输出a盘根目录下名为“string.txt”的文本文件读取的前20个字符组成的字符串。

【参考答案】

#include<stdio.h> #inclide<stdlib.h>/*因包含函数exit(0),故需在预编译时加入......

(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)
<上一题 目录 下一题>
热门 试题

填空题
给定程序中,函数fun的功能是将形参std所指结构体数组中年龄最大者的数据作为函数值返回,并在main函数中输出。#include<stdio.h>typedef struct{char name[10];int age;}STD;STD fun(STD std[],int n){STD max;int i;max=______; *第一空* for(i=1;i<n;i++)if(max.age<______)max=std[i]; *第二空* return max;}main(){STD std[5]={ aaa ,17, bbb ,16, ccc ,18, ddd ,17, eee ,15};STD max;max=fun(std,5);printf( n the result: n );printf( nName:%s,Age:%d n ,______,max.age); *第三空* }
填空题
以下程序能将字符串Program!反向打印出来,请填空。#include<stdio.h>void out(char *str){char *s=______; *第一空* if(*S==NULL)return;while(______)s++; *第二空* s--;printf( %c n ,*s);*s=NULL;______; *第三空* }main(){char c[]= Program! ;out(c);}
相关试题
  • 有一个字符串,包含n个字符。写一个函数,...