#include <iostream> #include <time.h> #include <signal.h> #include <vector> #include <string> #include <unistd.h> #include <stdlib.h> using namespace std; void sig_int (int signo); int main () { int seed, idx; cout << "排名不分先后,好不好听,听了你就知道了" << endl << "各种熟悉的旋律,每次听到都很有feel~"<<endl << "还有很多,不过到此为止吧" << endl; vector <string> music = {"Breathless--Shayne Ward", //曾经单曲循环好久的一首歌 "Until you--Shayne Ward", //肖恩的声音各种优美啊~ "Am I still the one--Daniel Powter",//知道并喜欢丹尼尔是从这首歌开始的 "As Long As You Love Me - Backstreet Boys", //后街男孩,不解释 "How did I fall in love with you - Backstreet Boys", "Free Loop--Daniel Powter", "Bad day--Daniel Powter", "Gotta Have You--The Weepies", "Just One Last Dance (Video Version) - Sarah Connor / Natural", "Love The Way You Lie - Eminem / Rihanna", "You Raise Me Up - Kenny G ", "Because I Love You - Shakin Stevens", "The Show - Lenka ", "You're Beautiful - James Blunt ", "Someone Like You - Adele", "The Sound Of Silence - Simon & Garfunkel ", "Only Love - Trademark ", "Valder Fields - Tamas Wells", //音乐响起各种熟悉吧~ "You Raise Me Up -- Westlife", "Beautiful in white -- Westlife", //感觉用作婚礼背景音乐超好的嗦~ "Anyone Of Us -- Gareth Gates", "Burning -- Maria Arredondo", "You Are Not Alone - Michael Jackson ", "Pretty Boy -- M2M", "Are You The One -- Timo Tolkki", "Because Of You -- Kelly Clarkson", "you belong with me - Taylor Swift ", "Love story -- Taylor Swift ", "Cry On My Shoulder - Deutschland Sucht den Superstar",//高三时候班主任英语老师教我们唱,很有感觉啊~ "The Day You Went Away - M2M ", "Take Me To Your Heart -- Michael Learns To Rock", "Today, Tonight, Tomorrow - Deutschland Sucht den Superstar ", "Not Going Anywhere -- Keren Ann", "Sunshine Girl -- moumoon", "Because I love you -- Shakin Stevens", "Seasons In The Sun -- WestLife", "We are young -- fun.", "apologize -- Timbaland", //各种耳熟能详~ "You are my everything -- Aviation", "Down -- Jason Walker" //虽然没看吸血鬼日记,但觉得这首歌挺好听的~ }; srand((unsigned) time (NULL)); signal (SIGINT, sig_int); seed = music.size(); cout << "根本挺不下来啊,有木有~" << endl; while (1) { idx = rand() % (seed); cout << music[idx] << endl; sleep (1); } return 0; } void sig_int (int signo) { }