
复试上机
文章平均质量分 69
Mr_Ystreet
来日可期
展开
-
2010上机二 中国象棋马走日
2、在半个中国象棋棋盘上,马在左下角(1,1)处,马走日字...而且只能往右走...不能向左...可上可下...求从起点到(m,n)处有几种不同的走法(函数的递归调用)/*在半个中国象棋棋盘上,马在左下角(1,1)处,马走日字...而且只能往右走...不能向左...可上可下...求从起点到(m, n)处有几种不同的走法*/#include <stdio.h>//棋盘的宽度和...原创 2017-03-03 20:01:15 · 817 阅读 · 0 评论 -
2012上机二 约瑟夫环
#include<stdio.h>#include<stdlib.h>void main() { int n, c,num=0,i=0,pos=-1; scanf("%d %d", &n, &c); int *a; a = (int *)malloc(sizeof(int) * n); for (int i = 0;i < n;i++)...原创 2017-03-03 19:56:05 · 322 阅读 · 0 评论 -
2013上机二 八皇后问题8*8 任意两个皇后不在同行同列对角
#include<iostream>using namespace std;int c[20], n = 8, cnt = 0;void print() { for (int i = 0;i < n;i++) cout << c[i]+1; cout << endl;}void search(int r) { if (r == n) {...原创 2017-03-03 19:48:38 · 746 阅读 · 0 评论 -
2015上机二 国际象棋跳马5*5
// 马踏棋盘1.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include<iostream>using namespace std;int a[5][5];int cnt = 0;void print() { for (int i = 0;i < 5;i++) { for (int j = 0;j < 5;j+...原创 2017-03-03 19:33:07 · 742 阅读 · 0 评论 -
2015上机一 输出字符串中连续出现最长的数字串及其开始的下标
题目: 2015 1、 设计一个程序,输入一个字符串以#结尾,则输出此字符串中连续出现最长的数字串及其开始的下标; 例如: 输入:ab125ef1234567# 输出: 1234567 开始位置为:8#include<stdio.h>#include<stdlib.h>#define MAX 30void main() {char a[MAX];int i =...原创 2017-02-23 14:51:39 · 1865 阅读 · 1 评论