Sbagli. Stampa eccome solo che non lo vedi
#include <iostream>
#include <cstdlib>
#include <time.h>
int main()
{
srand (time(NULL));
int val = rand() % 3;
switch(val)
{
case 0: std::cout << "1" << std::endl; break;
case 1: std::cout << "X" << std::endl; break;
case 2: std::cout << "2" << std::endl; break;
}
std::cin.get();
}