Jump to content

Topic pentru discutii


Dyablox
 Share

Recommended Posts

#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    int a,b,c,x,nr,x1,p;
    nr = 0;
    cout << "Introduceti a, b, c, si x";
    cin >> a >> b >> c >> x;
    x1 = x;
    if (x1 == 0)
		nr = 1;
	else
	{
		while (x1)
		{
			nr++;
			x1 = x1 / 10;
		}
	}
	p = x/(pow(10,nr-1));
	if (a == nr & p == b & x%10 == c)
        cout << "DA";
    else cout << "Nu";
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.