請參考我的做法 import java.util.*; public class Y5435 { public static void main(String[] args) { // Q1 int[] ary1 = new int[26]; char[] ary2 = new char[100]; for (int i = 0; i < 100; i++) { int x = (int)(Math.random() * 26); char c = (char)(x + 'a'); ary1[x...
分類:電腦與網際網路 > 程式設計 2012年12月16日
#include <stdio.h> #include <stdlib.h> char str[256]=""; int numpal(int begin, int end) { if ( begin == end ) { return 1; } else if ((end - begin) == 1) { return (*(str + begin) == *(str + end)); } else if (*(str + begin) == *(str + end)) { return numpal(++begin,--end); } else...
分類:電腦與網際網路 > 程式設計 2009年04月05日
請參考我的做法 import java.util.*;class MyCaesarCipherEncryption { public static String encrypt(String s, int n) { String encrypted = ""; for (int i = 0; i < s.length(); i++) { char c = (char)((s.charAt(i) + n) % 126); if (c...
分類:電腦與網際網路 > 程式設計 2008年11月20日
1.a(4.25) #include <iostream> #include <cstdlib> using namespace std; int main() { int num, i, j; cin >> num; if (1 <=num && num <=20) { for (j=1;j<=num;j++)cout << "*"; cout...
分類:電腦與網際網路 > 程式設計 2008年11月10日
...original direction vs. the probability of backscattering, and vs. the probability for turning to other...i, j common /nd/nd ! Direction: 1= Forward , 6= Backward , 2=Up, 3=Right, 4=Left...
分類:電腦與網際網路 > 程式設計 2010年10月25日
首先你需要設計 double linked list 的 node, 例如:typedef struct _DLL_Node DLL_Node;struct _DLL_Node { DLL_Node *priv, DLL_Node *next, char *data};data 就可以用來放每行的資料. 我不知道你的 "區塊" 是怎樣...
分類:電腦與網際網路 > 程式設計 2010年12月14日