20170314

来源:互联网 发布:程序员培训全日制吗 编辑:程序博客网 时间:2024/04/30 08:00
#include <iostream>
#include <time.h>
using namespace std;
int main()

{


猜数字1.1版本


//int i, j ,cnt=1;


//srand(time(0));
//j = rand() % 100 + 1;


//cout<<"Guess a FUCKING number between 1~99\n";


//while(cin >> i)
//{
// /*if (cnt = 5)
// {
// cout << "" << j % 10;
// }*/




//
//
// if (i < j)
// {
// cout << "Maybe it is more bigger than your thoughts\n";
// cnt++;
// continue;


// }
// else
// if (i > j)
// {
// cout << "Maybe it is more smaller than your thoughts\n";
// cnt++;
// continue;


// }
//
// /*cout << "Maybe it is more flexible than your thoughts\n";*/
// else;
// break;
//
//}
//
//cout << "Congratulations! You finally got it in " << cnt << " times\n";
//


简单的指针操作


//int arr1[3] = { 1, 3, 4 };
//int *pi = arr1;
//printf("%d\n", *(pi+1));


日期计算器


int y=2017,y2,m=3,m2, d=15,d2,;//Year,Month,Day

/*int arr[] = { 1,-1,0,0,1,1,2,3,3,4,4,5 };
int *pi = arr;
*/
cin >> "Input your Date" >> y2 >> m2 >> d2;



/*sum = (y2 - y) * 365 + (m2 - m) * 30 + (d2 - d) + *(pi + m);*/


sum = y2 + m2 + d2;


cout << "Distance is " << sum << " days";


system("pause");
return 0;
}
0 0