解题思路:
int abs(int i)
double fabs(double i)
float fabsf(float i)
long double fabsl(long double i)
注意事项:
参考代码:
#include<stdio.h> #include<math.h> int main() { int a[3][4],max=0,row=0,column=0; for(int i=0;i<3;i++) { for(int j=0;j<4;j++) { scanf("%d",&a[i][j]); a[i][j]=abs(a[i][j]); } } for(int i=0;i<3;i++) { for(int j=0;j<4;j++) { if(max<a[i][j]) { max=a[i][j]; row=i; column=j; } else if(max==a[i][j]&&j<column) { row=i; column=j; } } } printf("%d %d %d",max,row+1,column+1); return 0; }
0.0分
0 人评分
C语言训练-计算t=1+1/2+1/3+...+1/n (C语言代码)浏览:532 |
C语言训练-求1+2!+3!+...+N!的和 (C语言代码)浏览:2485 |
程序员的表白 (C语言代码)浏览:1404 |
C语言程序设计教程(第三版)课后习题6.3 (C语言代码)浏览:535 |
矩阵乘法 (C++代码)浏览:1646 |
C语言程序设计教程(第三版)课后习题4.9 (C语言代码)浏览:383 |
C语言程序设计教程(第三版)课后习题9.6 (C语言代码)浏览:385 |
简单的a+b (C语言代码)浏览:526 |
剪刀石头布 (C++代码)浏览:1804 |
小九九 (C语言描述,不看要求真坑爹)浏览:999 |