Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Numerics;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- //First case
- Console.WriteLine("first: null; second: \"aa\"");
- string first = null;
- string second = "aa";
- string matrixNullMessage = first == null ? " first" + (second==null?" and second matrices ":" matrix ") :
- "" + (second==null?" second matrix ":"");
- string message = "The" + matrixNullMessage + "not initialised.";
- Console.WriteLine(message + "\n");
- //Second case
- Console.WriteLine("first: null; second: null");
- first = null;
- second = null;
- matrixNullMessage = first == null ? " first" + (second == null ? " and second matrices " : " matrix ") :
- "" + (second == null ? " second matrix " : "");
- message = "The" + matrixNullMessage + "not initialised.";
- Console.WriteLine(message+"\n");
- //Third case
- Console.WriteLine("first: \"aa\"; second: null");
- first = "aa";
- second = null;
- matrixNullMessage = first == null ? " first" + (second == null ? " and second matrices " : " matrix ") :
- "" + (second == null ? " second matrix " : "");
- message = "The" + matrixNullMessage + "not initialised.";
- Console.WriteLine(message + "\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement