.7Р NР Р Y Рis DialogueР Р Рch<0.4Рis LectureРch>=0.4Рis MixedР Р五.源程序代码:Р#include <stdio.h>Р#include <stdlib.h>Р#define N 3Рmain()Р{Р char a[N];Р char tmp;Р int i,s=0,t=0,g=1;Р float rT,ch,rS;Рprintf("\nplease input the action use T or S:\n");Рgets(a);Рtmp=a[0];Рfor(i=0;i< N;i++)Р { if (a[i]=='T')Р t++;Р else s++;Р if(tmp!=a[i])Р {g++;Р tmp=a[i];Р }Р }Р rT=(float )t/N*100;Р ch=(float)(g-1)/N;Р rS=100-rT;Р printf("Rt=%2.2f% ",rT);Р printf("Rs=%2.2f% \n",rS);Р printf("Ch=%2.2f\n",ch);Рif(rT<=0.3)Р printf("The instruction mode is Practice.");Рelse if(rT>=0.7)Р printf("The instruction mode is Dialogue.");Р else { if(ch<0.4)Р printf("The instruction mode is Mixed.");Р }Р if(ch>=0.4)Р printf("The instruction mode is Lecture.") ;Р }Р六.运行结果:Р教Р育Р信Р息Р处Р理Р实Р验Р报Р告Р三Р 计算机科学学院Р08级教育01班Р40809020107Р贺行行