定义一个字符指针数组,存放10个学生的姓名,查找有没有叫“Jack”的,有则输出—1?

沈俊萍

定义char类型指针数组用来存储十个学生的姓名,使用函数实现查找第

定义一个字符指针数组,存放10个学生的姓名,查找有没有叫“Jack”的,有则输出—1?

#include<stdio.h>void find(char *p[10],int n){ printf("%s\n",p[n-1]);}void main(){ char *p[10]={"aa","bb","cc","dd","ee","ff","gg","hh","ii","jj"}; find(p,6);}

1. 定义一个数组stu[10]存放10个学生的成绩,从键盘输入数据,要求用

可不可以具体点,就是在哪步用指针实现:#include <iostream>using namespace std;int main(){ double stu[10]; cout<<"Please input the scores of the students"<<endl; for(int i=0;i<10;i++) { cin>>stu[i]; } cout<<"You array is:"<<endl; for(int i=0;i<10;i++) { if(i%4==0) cout<<endl; cout<<stu[i]<<'\t'; } system("PAUSE"); return 0;}

/*定义一个数组stu[10]存放10个学生的成绩,实现下列函数:.

#include main() { float stu[10],*p=stu; int i; printf("input 10 score:"); for(i=0;i scanf("%f",p+i); for(i=0;i printf("%5.0f",*(p+i)); printf("\n"); }

(1)定义一个结构体数组,存放10个学生的学号,姓名,三门课的成绩

#include <stdio.h> #include <string.h>typedef struct STU {char ID[20];//学号char Name[20];//姓名float math;//成绩1float chinese;//成绩2float english;//成绩3 };.

1) 定义一个数组stu[10]存放10个学生的成绩,从键盘输入数据,要求

if (*(p+i)&lt;*(p+i+1)){ *(p+i)=t;//这里错了,应是t=*(p+i);在把*(p+i)赋新值之前应先保存其旧值 *(p+i)=*(p+i+1); *(p+i+1)=t;}

定义一个二维数组,用来存储某班10位学生的姓名,并输出学生姓名

char name[][];前一个空号里添0到9后一个为姓名用for循环输出

二维数组键盘输入存放十个学生姓名,再输入待查找学生姓名,判断是

#include "stdio.h"typedef struct student{ char name[20]; int num; int score;}STU;void main(){ STU student[10];int pass=60,j,i; printf("输入学生的信息,每输入一个名字和学号之后按空格,输入一个成绩之后按回车:\n"); for(j=0;j评论0 00

学生成绩单制作 (1)定义一个结构体数组,存放10个学生的学号

#difine N 10 type struct{ int Number; char name; float math; float chinese; float rnglish; } student[N];

1. 定义一个结构体数组,存放10个学生的学号,姓名,三门课的成绩

struct student {long num; char name[20]; float chinese; float math; float english; }stud[10];

Java10个学员姓名存储在数组中,查找此班级是否有用户输入的学员

当然没找到换成这个if(name[i].equals(student))