[4-1]

#include<stdio.h>

main()

{

 int@score[30]={100,52,43,11,33,95,5,78,65,53,98,18,27,44,65,

80,89,20,91,77,14,45,31,70,99,30,70,55,10,28};

 int pass=0,unpass=0;

 int i;

 

 for(i=0;i<30;++i){

    if(score[i]>=60) ++pass;

    else ++unpass;

 }

 printf("Passed number: %d\n",pass);

 printf("Unpassed number: %d\n",unpass);

}

 

[4-2]

#include<stdio.h>

main()

{

 char sei[21],mei[21],sei_mei[42];

 int i,j;

 

 printf("Enter full name (ex. yamamoto-momoko): ");

 scanf("%s",sei_mei);

 

 for(i=0;i<42;++i){

    if(sei_mei[i]=='-') break;

    sei[i]=sei_mei[i];

 }

 sei[i]='\0';

 

 for(j=i+1;j<42;++j){

    mei[j-i-1]=sei_mei[j];

    if(sei_mei[j]=='\0') break;

 }

 

 printf("family name= %s, first name= %s\n",sei,mei);

}