int nums[ROWS][COLS]={{1000,1000,1000,1000}, {900,500,400,100}, {90,50,40,10}, {9,5,4,1}}; char *roms[ROWS][COLS]={{“m”,”m”,”m”,”m”}, {“cm”,”d”,”cd”,”c”}, {“xc”,”l”,”xl”,”x”}, {“ix”,”v”,”iv”,”i”}}; main(int argc,...
include <stdio.h>#include <string.h>int main(){ char* digits[10] = {"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"}; char* tens[10] = {"", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "...
include "stdafx.h"include<stdio.h> // 罗马字符串转数字 int GetNumber(const char* strNum){ int nValue = 0;while(*strNum != '\0'){ int nN = 0;char c = *(strNum+1);switch(*strNum){ case 'I':nN = ((c != 'V' && c!= 'X') ? 1 : -1);break;case 'V'...
int const map[] = {//a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z0, 0, 100, 500, 0, 0, 0, 0, 1, 0, 0, 50, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 10, 0, 0};void roman(char...
主要是因为a里面残留了上次输入的数据,你在while语句的最后加一句话:memset(a, 0, 100);就OK了