Cześć i witam
Próbuję napisać program, symulujący gre oczko i mam pewien problem.
// ConsoleApplication2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <time.h>
using namespace std;
int main()
{
int A;
srand(time(NULL));
A = rand() % 11;
printf("Twoja pierwsza liczba: %d\n", A);
int B;
B = A + rand() % 11;
printf("Pierwsze losowanie: %d\n", B);
printf("Wylosowac kolejna liczbe?\n");
char x;
scanf_s("%c", &x);
if (x = 'T')
{
int C;
C = B + rand() % 11;
printf("Wynik po dobraniu: %d\n", C);
}
else (x = 'N')
{
printf("Koniec gry, wynik: %d\n", B);
}
return 0;
}
nie chce mi skompilować, w wyjasnieniu problem pojawia się przy komendzie if/else
co może być źle?