Problem C: 零起点学算法93——矩阵转置
#include<stdio.h>
int main()
{
int n,m,a[][],b[][];
while(scanf("%d%d",&n,&m)!=EOF)
{ for(int i=;i<n;i++)
{
for(int j=;j<m;j++)
{
scanf("%d",&a[i][j]);
}
} for(int i=;i<m;i++)
{
for(int j=;j<n;j++)
{
b[i][j]=a[j][i];
}
} for(int i=;i<m;i++)
{
for(int j=;j<n-;j++)
{
printf("%d ",b[i][j]);
}
printf("%d\n",b[i][n-]);
}
}
return ;
}
Problem C: 零起点学算法93——矩阵转置的更多相关文章
- Problem D: 零起点学算法95——弓型矩阵
#include<stdio.h> #include<string.h> int main() { ][]; while(scanf("%d%d",& ...
- Problem D: 零起点学算法94——输出矩阵
#include<stdio.h> int main() { ][]; while(scanf("%d %d",&n,&m)!=EOF) { ; ;i& ...
- 1186: 零起点学算法93——改革春风吹满地(C)
一.题目 http://acm.wust.edu.cn/problem.php?id=1186&soj=0 二.分析 多组输入,'0'结束: 顶点的个数在3至100之间: 一定顺序输入坐标: ...
- Problem H: 零起点学算法109——单数变复数
#include <stdio.h> #include<string.h> int main(void) { int n; ]; scanf("%d",&a ...
- Problem G: 零起点学算法106——首字母变大写
#include<stdio.h> #include<string.h> int main(void) { ]; int i,k; while(gets(a)!=NULL) { ...
- Problem F: 零起点学算法42——多组测试数据输出II
#include<stdio.h> int main() { ; while(scanf("%d%d%d",&a,&b,&c)!=EOF) { ...
- Problem E: 零起点学算法34——3n+1问题
#include<stdio.h> #include<math.h> int main() { int n; n<=pow(,); ; scanf("%d&qu ...
- Problem K: 零起点学算法107——统计元音
#include<stdio.h> int main() { int n; ]; while(scanf("%d%*c",&n)!=EOF) { while(n ...
- Problem J: 零起点学算法105——C语言合法标识符
#include<stdio.h> #include<ctype.h>//调用isalpha函数 int main() { int n; ]; while(scanf(&quo ...
随机推荐
- java封装示例代码
package com.imooc; public class Telphone { private float screen; private float cpu; private float me ...
- Linux目录结构与文件权限——(五)
1.目录结构
- Spark实现销量统计
package com.mengyao.examples.spark.core; import java.io.Serializable; import org.apache.hadoop.io.Nu ...
- Linux 入门记录:十三、Linux 扩展权限
一.默认权限 每一个终端都有一个 umask 属性,是用来确定新建文件或目录的默认权限的“掩码”(mask 有“掩码”的含义,至于 u,后面说). Linux 中一般有默认的权限掩码,使用命令 uma ...
- 2017多校第8场 HDU 6138 Fleet of the Eternal Throne 思维,暴力
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6138 题意:给了初始区间[-1,1],然后有一些操作,可以r加上一个数,l减掉一个数,或者同时操作,问 ...
- 一个真正的客户端非阻塞的 connect
前言 - 一个简短开场白 winds 的 select 和 linux 的 select 是两个完全不同的东西. 然而凡人喜欢把它们揉在一起. 非阻塞的connect业务是个自带超时机制的 conn ...
- 批量导出文件名 另存为bat文件
@echo offdir /b *.* > 导出的文件名.txtexit
- mongodb循环
var rds = db.REGIPATIENTREC.find({mzh:{$lt:"0"},usrOrg:"石景山中西医结合医院"}); var show ...
- Python+Selenium 自动化实现实例-Css捕捉元素的几种方法
#coding=utf-8 from selenium import webdriverimport timedriver = webdriver.Chrome()driver.get("h ...
- 8种json数据查询方式
你有没有对“在复杂的JSON数据结构中查找匹配内容”而烦恼.这里有8种不同的方式可以做到: JsonSQL JsonSQL实现了使用SQL select语句在json数据结构中查询的功能. 例子: ? ...