ZJU PAT 1011

http://pat.zju.edu.cn/contests/pat-practise/1011

示例数据是错的。。。

 1 #include <stdio.h>
2 double mat[3][3]={0};
3 char map[]={'W','T','L'};
4 int main()
5 {
6 int i,j;
7 for(i=0;i<3;i++)
8 for(j=0;j<3;j++)
9 scanf("%lf",&mat[i][j]);
10 int pos[3];
11 for(i=0;i<3;i++){
12 double max=0;
13 int j=0;
14 for(;j<3;j++){
15 if(mat[i][j]>max){
16 max=mat[i][j];
17 pos[i]=j;
18 }
19 }
20 }
21 // printf("%d %d %d\n",pos[0],pos[1],pos[2]);
22 double fin=(mat[0][pos[0]]*mat[1][pos[1]]*mat[2][pos[2]]*0.65-1.0)*2.0;
23
24 printf("%c %c %c %.2lf\n",map[pos[0]],map[pos[1]],map[pos[2]],fin);
25 }

posted @ 2011-10-09 10:10  linyvxiang  阅读(220)  评论(0编辑  收藏  举报