题解 1115: DNA

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

DNA (C语言代码)非常易懂(类似于菱形的打印输出)

解题思路:行与列的关系注意事项:注意重复输出时,我们可以看作是两个图形,比如样例中的31与54,其中54就可以看作是5行与3行交替出现的结果,可以利用输出次数count%2==1时,输出5行,count%2==0时输出3行,如此类推即可。参考代码:#includeintmain(){

DNA (C语言代码)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>void dna(int n){ int i,k=2,j; for(j=2;j<=n;j++) { for(i=1;i<=n;i++)……

DNA (C语言代码)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int z,i[15],j[15]; int a,x,y,m,n,c; scanf("%d",&z); for(……

DNA (C语言代码)

摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <string.h>int main(){ int DNA[50][50]; int n,a,b; int i,j;……

DNA (C语言代码)

摘要:解题思路:维护二维数组注意事项:回车参考代码:import java.util.Scanner; public class Main { public static void main……

DNA (C语言代码)

摘要:参考代码:#include <stdio.h> #include <math.h> #include <stdlib.h> void deal(int a,int b) {     in……

DNA (C语言代码)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>void f(int a);void output(int a,int c);char str[100][100];int a[15][……

DNA (C语言代码)

摘要:解题思路:      考虑行数、列数与重复度的关系注意事项:      重复度等于1时的情况特殊处理参考代码:#include <stdio.h>int main(){    int n;    sc……

DNA (C语言代码)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n, a, b, i, j; char ch[40][40]; scanf("%d", &n); whi……

DNA (C语言代码)

解题思路:这类图形题,看行与列的关系(你可以看成坐标系)。这里以3行为例(5行同理):i(行)/j(列)1231xx2x3xx观察到了什么规律呢?当i=j的时候输出还有i+j=4的时候输出,其他时候输出空格。注意事项:参考代码:A.我们一步一步来实现需求,