Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- cout<<"請輸入數字:";
- cin>>n;
- while(n>0)
- {
- int A[50]={0},c=0;
- while(n)
- {
- A[c++]=n%7;
- n/=7;
- }
- cout<<"7進位是:";
- for(int i=c-1;i>-1;i--)
- {
- cout<<A[i];
- }
- cout<<endl;
- cout<<"請輸入數字:";
- cin>>n;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement