如題
請各位大大幫忙
謝謝
#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
int main()
{
char a[6];
int b[6];
while(gets(a))
{
for(int i=0;i<7;i++)
{
switch(a[i])
{
case 'A':
b[i]=1;
break;
case 'B':
b[i]=2;
break;
case 'C':
b[i]=3;
break;
case 'D':
b[i]=4;
break;
case 'E':
b[i]=5;
break;
case 'F':
b[i]=6;
break;
case 'G':
b[i]=7;
break;
case 'H':
b[i]=8;
break;
case 'I':
b[i]=9;
break;
case 'J':
b[i]=10;
break;
case 'K':
b[i]=11;
break;
case 'L':
b[i]=12;
break;
case 'M':
b[i]=13;
break;
case 'N':
b[i]=14;
break;
case 'O':
b[i]=15;
break;
case 'P':
b[i]=16;
break;
case 'Q':
b[i]=17;
break;
case 'R':
b[i]=18;
break;
case 'S':
b[i]=19;
break;
case 'T':
b[i]=20;
break;
case 'U':
b[i]=21;
break;
case 'V':
b[i]=22;
break;
case 'W':
b[i]=23;
break;
case 'X':
b[i]=24;
break;
case 'Y':
b[i]=25;
break;
case 'Z':
b[i]=26;
break;
}
}
for(int u=1;u<7;u++)
{
cout<<abs(b[u]-b[u-1])%10;
}
cout<<endl;
}
return 0;
}
CE ()
編譯錯誤
code_953509.cpp: In function ‘int main()’: code_953509.cpp:97: error: ‘abs’ was not declared in this scope