标签:表示 class output mis miss 数据包 ber tput ted
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 49640 Accepted Submission(s): 27279
#include <iostream> #include<math.h> #include <iomanip> #include<cstdio> #include<string> #include<map> #include<vector> #include<list> #include<algorithm> #include<stdlib.h> #include<iterator> #include<sstream> #include<string.h> using namespace std; int main() { int m,n;//m->number n->jinzhi while(cin>>m>>n) { char a[100]={" "}; int cnt=0;//记录有几位数 int temp=0; int num=0; if(m>=0) { while(m>0) { temp=m%n; if(temp<10) { a[cnt]=temp+48; cnt++; } else { a[cnt]=temp+55; cnt++; } m=m/n; } for(int i=cnt-1;i>=0;i--) { if(i!=0) { cout<<a[i]; } else { cout<<a[i]<<endl; } } } else { m=-m; while(m>0) { temp=m%n; if(temp<10) { a[cnt]=temp+48; cnt++; } else { a[cnt]=temp+55; cnt++; } m=m/n; } cout<<"-"; for(int i=cnt-1;i>=0;i--) { if(i!=0) { cout<<a[i]; } else { cout<<a[i]<<endl; } } } } return 0; }
标签:表示 class output mis miss 数据包 ber tput ted
原文地址:http://www.cnblogs.com/William-xh/p/6912691.html