#include<iostream> using namespace std; int main() { int sum; sum=0; cout<<"sum="<<sum<<endl; sum=sum+1; cout<<"sum="<<sum<<endl; //sum+=1; sum=sum+2; cout<<"sum="<<sum<<endl; //sum+=2; sum=sum+3; cout<<"sum="<<sum<<endl; sum=sum+4; cout<<"1+2+3+4="<<sum<<endl; return 0; }
scratch2代码
scratch3代码