fork(1) download
  1. Imports System
  2.  
  3. Public Class Test
  4. Public Shared Sub Main()
  5. ' your code goes here
  6. End Sub
  7. End Class
Success #stdin #stdout 0s 23992KB
stdin
void substitution_encrypt()
{
    char s[10] = "Hello!", t[10] = "";
 
    // 建立轉換表格
    char table[128];
    for (int i=0; i<128; i++) table[i] = i;
    table['!'] = 'w';
    table['H'] = 'Y';
 
    // 開始轉換
    int n;
    for (n=0; s[n] != '\0'; n++)
        t[n] = table[ s[n] ];
    t[n] = '\0';
}
 
void substitution_decrypt()
{
    // 省略
}
 
void transposition_encrypt()
{
    char s[10] = "Hello!", t[10] = "";
 
    // 建立轉換表格
    int table[50];
    for (int i=0; i<50; ++i) table[i] = i;
    table[2] = 3;
    table[3] = 5;
    table[5] = 2;
 
    // 開始轉換
    int n;
    for (n=0; s[n] != '\0'; n++)
        t[n] = table[ s[n] ];
    t[n] = '\0';
}
 
void transposition_decrypt()
{
    // 省略
}
stdout
Standard output is empty