最近打算做一个关于身份证号码查询的API,因此在网路上查了一些关于身份证号码相关的知识。根据对GB11643-1989的解读,身份证号码的前身是“社会保障号码”,国家质量技术监督局于1999年7月1日实施的GB11643-1999《公民身份号码》是GB11643-1989《社会保障号码》的修订版,其中指出将原标准名称“社会保障号码”更名为“公民身份号码”,另外GB11643-1999《公民身份号码》从实施之日起代替GB11643-1989。 身份证号码组成: 按照 GB11643—1999《公...
#include <iostream> using namespace std; int myFunc(int,int); //用递归的方式计算指数次幂 int main() { int x,y,z,a,b; cout<<“请输入两个数,例如x和y,程序计算他们的指数次幂。”<<“n”<<“第一个数:”; cin>>x; cout<<“第二个数:”; cin>>y; a=x; b=y; z=myFunc(x,y); cout<<a<<“的”<<b<<“次方是”<<z<<endl; return 0; } int myFunc(int x,int y) { if (y=...
//函数的递归 #include <iostream> using namespace std; int fib(int n); int main() { int n,answer; cout<<“Enter Number to find:”; cin>>n; cout<<“nn”; answer=fib(n); cout<<answer<<” is the “<<n; cout<<“th Fibonacci numbern”; return 0; } int fib(int n) { cout<<“Processing fib(“<<n<<“)…”; if(n<3) { cout<<“Return 1!n”; re...
#include <iostream> using namespace std; int Double(int); long Double(long); float Double(float); double Double(double); int main() { int myInt = 6500; long myLong = 65000; float myFloat = 6.5f; double myDouble = 6.5e20; int doubledInt; long doubledLong; float doubledFloat; double doubledDouble; cout<<“myInt:”<<myInt<<endl; cout<<“myLong:”<<myLong<<endl; cout<<“myFloat:”<<myFloat<<endl...
#include <iostream> void main() { typedef unsigned short int USI; const USI Sunday = 0; const USI Monday = 1; const USI Tuesday = 2; const USI Wednesday = 3; const USI Thursday = 4; const USI Friday = 5; const USI Saturday = 6; USI Today = Sunday; if (Today == Sunday || Today == Saturday) std::cout << “nGotta Weekends!n”; else std::cout << “nGo to work!n”; } #include <iostream> int main() { enum Days {Sunday,Monday,Tuesday,Wednes...
#include <iostream> int main() { for (unsigned char i = 32;i<128;i++) std::cout << i; std::cout << std::endl; return 0; }