Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

29544 755466 謝奕宏 #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions 755466/類似IG的東西.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#include <iostream>
#include <time.h>
#include <stack>
#include <string>
using namespace std;

int main() {
string n;
stack<string> ID;
stack<string> Web;
stack<string> Pic;
stack<string> Time;

while(true){
cout << "你的ID(輸入0 結束po文) :";
cin >> n;
if (n == "0"){
cout << "結束po文\n";
break;
}
ID.push(n);
cout << "輸入網址:";
cin >> n;
Web.push(n);
cout << "輸入內文:";
cin >> n;
Pic.push(n);
time_t now = time(0) + 28800;
Time.push(ctime(&now));
}

cout << "==========\n";
while(!ID.empty()){
cout << "ID:" << ID.top();
ID.pop();
cout << endl;
cout << "網址:" << Web.top();
Web.pop();
cout << endl;
cout << "照片:" << Pic.top();
cout << endl;
Pic.pop();
cout << "發文時間:" << Time.top();
Time.pop();
cout << "==========\n";

}

}
/*
IG:

ID
網址
照片
times
*/