#include<iostream>
#include<iomanip>
#include<string>
#include<sstream>
bool is_leap_year (unsigned year) { return !(year%400) (!(year%4) && (year%100)); };
unsigned count_leap_years (unsigned year) { return year/4-year/100+year/400; };
unsigned day_of_year (unsigned y, unsigned m, unsigned d);
unsigned long long count_days (unsigned y, unsigned m, unsigned d) {
return 365ULL * (y-1) + count_leap_years(y-1) + day_of_year (y, m, d);}
// compute day of year (January 1st == day 1)
unsigned day_of_year (unsigned y, unsigned m, unsigned d) {
static int DayOfMonth[] = {0,31,59,90,120,151,181,212,243,273,304,334};
return DayOfMonth[m-1] + d + ((m>2 && is_leap_year(y))? 1 : 0);
}
std::ostream& centre_text (std::ostream& os, std::string& str, size_t width) {
if (str.size()<width) {
unsigned spaces {(width-str.size())/2};
while (spaces-->0) os << ' ';
}
return os << str;
}
std::ostream& calendar(std::ostream& os, unsigned y, unsigned m)
{
using namespace std;
string Month[] {"January", "February", "March",
"April", "May", "June",
"July", "August", "September",
"October", "November", "December"};
string Week {"Su Mo Tu We Th Fr Sa"};
unsigned DayOfMonth[] {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
if (is_leap_year (y)) DayOfMonth[1] = 29;
stringstream ss {}; ss << y; // convert year to string
string s {Month[m-1] + ' ' + ss.str()};
os << endl;
centre_text (os, s, Week.size()) << endl;
os << Week << endl;
unsigned first_day {count_days (y, m, 1) % 7};
for(unsigned i {};i<first_day; ++i)
os << " "; // three spaces
for(unsigned i {first_day}, day {1}; day<=DayOfMonth[m-1]; ++i, ++day) {
os << setw(2) << day << ' ';
if(i%7==6) os << endl;
}
return os << std::endl;
}
int main(void){
unsigned year,month;
std::cout << "Enter the month and year: ";
std::cin >> month >> year;
calendar(std::cout, year, month);
}
PRINT 2,3,5,7,11,13,17,19,23,29,31,37
there is no solution of this problem...........that's it..........
Compute means to calculate. What do you want to "compute", if you already know it is 2? If you want to show the value:System.out.println("Your number is " + 2);Compute means to calculate. What do you want to "compute", if you already know it is 2? If you want to show the value:System.out.println("Your number is " + 2);Compute means to calculate. What do you want to "compute", if you already know it is 2? If you want to show the value:System.out.println("Your number is " + 2);Compute means to calculate. What do you want to "compute", if you already know it is 2? If you want to show the value:System.out.println("Your number is " + 2);
Identification division. Program-id. Quadratic. Environment division. Data division. Working-storage section. 01 a pic 9(3) value 0. 01 b pic 9(3) value 0. 01 c pic 9(3) value 0. 01 d pic 9(3) value 0. 01 e pic 9(3) value 0. 01 f pic 9(3) value 0. 01 g pic 9(3) value 0. 01 h pic 9(3) value 0. 01 x1 pic 9(3) value 0. 01 x pic z(3).z(2) value 0. 01 x2 pic 9(3) value 0. 01 y pic z(3).z(2) value 0. Procedure division. Display "Written by Martin O. Egua, but not complete". Display "Quadratic equation solver for three values a, b & c" Display "Enter a number: " Accept a. Display "Enter the second number: " Accept b. Display "Enter the last number: " Accept c. compute d = (b * b) compute e = 4 * a * c compute f = 2 * a compute g = d - e compute h = function sqrt (g). compute x1 = (-b) + h compute x = x1 / f Display "X = " x compute x2 = (-b) - h compute y = x2 / f Display "Y = " y Display "Send the accurate program". Stop run.
int main (void) { printf ("%ld\n", 365L*24*60*60); } or int main (void) { printf ("%ld\n", 366L*24*60*60); }
The verb for computer is compute.Other verbs are computes, computing and computed."I am computing"."We have computed the program""I like to compute".
{A program to compute the area of a triangle} {by Ogboin W. Meshach} Var; b,h:real; BEGIN Writeln('Triangle'); Write('Base: '); Readln(base); Write('Height: '); Readln(height); area:=0.5*base*height; Writeln('Area: ', area :0:2); End.
Write a c program to compute the surface area and volume of a cube
PRINT 2,3,5,7,11,13,17,19,23,29,31,37
This isn't a question!
iCal is a fantastic calendar program, which allows you to set appointments and tasks. It is also free with Snow Leopard!
There is a lifetime calendar program with dates for every month of the year:
there is no solution of this problem...........that's it..........
What is the assembly program to generate a geometric series and compute its sum The inputs are the base root and the length of the series The outputs are the series elements and their sum?
A tourist can stay in the country for up to 90 days within a calendar year under the ESTA program.
int x= 1; int y= 2;
$n = 10*(1+10)/2;