Thanks to Evil Loco
Name String/Show Date
Code:
#include <iostream>
#include <string>
#include <stdio.h>
int day, month, year;
char info[] = "05/09/2010";
using namespace std;
int main()
{
system("title Bl4Ck.KiD...'s String Program");
system("color 9c");
cout << "Bl4Ck.KiD...'s String Program\n\n";
cout << "Type Your Name Here: ";
string full_name;
getline( cin, full_name );
int middle = full_name.size() / 2;
string greeting = "\nHello " + full_name + ", Ima Bob ";
cout << greeting << "Nice To Meet You, \n" << endl
<< full_name << " The Date Today Is... \n"
<<endl;
sscanf(info, "%d/%d/%d", &day, &month, &year);
printf("Day: %d\n",day);
printf("Month: %d\n",month);
printf("Year: %d\n",year);
system("pause");
std::getchar();
return 0;
}
Date/Month/Year String Still A Lil Messed Up But Ill Fix Later
Code:
#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
int main()
{
system("title Bl4Ck.KiD...'s String Program");
system("color 9c");
cout << "Bl4Ck.KiD...'s String Program\n\n";
cout << "Type What Number Day Is It Here: \n" << endl;
cout << "Type What Month It Is Here: \n" <<endl;
cout << "Type What Year It Is Here: \n" <<endl;
string day;
string month;
string year;
getline( cin, day );
getline( cin, month );
getline( cin, year );
int first = day.size() / 2;
int middle = month.size() / 2;
int end = year.size() / 2;
string greeting = day + "/" + month + "/" + year;
cout << greeting << "\n Thats What It Is Today \n" << endl;
system("pause");
std::getchar();
return 0;
}
Bookmarks