C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int a = 11;
int b = 2;
a -= b -= a -= b += b -= a;
System.Console.WriteLine(a);
}
}
}
输出:27
C++:
#include "stdafx.h"
#include<iostream>
int _tmain(int argc, _TCHAR* argv[])
{
int a = 11;
int b = 2;
a -= b -= a -= b += b -= a;
std::cout<<a<<std::endl;
return 0;
}
输出:76
相同的代码有不同的输出,有人能说出为什么会这样吗?帮助赞赏!