#include<iostream>
using namespace std;
void main()
{
int sa,sb,sc; //sa,sb,sc分别表a,b,c瓶子实际盛水量
int la=10,lb=3,lc=7,sum=10; //la,lb,lc表各瓶子的容量,sum表水的总量。
sa=sum;
sb=0;
sc=0;
while(sc<lc)
{
sc++;
}
cout<<"sa="<<(sa-sc)<<",sb="<<sb<<",sc="<<sc<<"\n";
sa=sa-sc;
do{sb++;}while(sb<lb);
cout<<"sa="<<sa<<",sb="<<sb<<",sc="<<(sc-sb)<<"\n";
sc=sc-sb;
if(sb==lb)
{
sa=sa+sb;
sb=sb-lb;
}
cout<<"sa="<<sa<<",sb="<<sb<<",sc="<<sc<<"\n";
while(sb<lb){sb++;};
cout<<"sa="<<sa<<",sb="<<sb<<",sc="<<(sc-sb)<<"\n";
sc=sc-sb;
if(sb==lb)
{
sa=sa+sb;
sb=sb-lb;
}
cout<<"sa="<<sa<<",sb="<<sb<<",sc="<<sc<<"\n";
if(sb==0)
{
sb=sb+sc;
sc=sc-sc;
}
cout<<"sa="<<sa<<",sb="<<sb<<",sc="<<sc<<"\n";
while(sc<lc)
{sc++;}
sa=sa-sc;
cout<<"sa="<<sa<<",sb="<<sb<<",sc="<<sc<<"\n";
while(sb!=lb)
{
sb++;
sc--;
}
cout<<"sa="<<sa<<",sb="<<sb<<",sc="<<sc<<"\n";
while(sb!=0)
{
sb--;
sa++;
}
cout<<"sa="<<sa<<",sb="<<sb<<",sc="<<sc<<"\n";
}
using namespace std;
void main()
{
int sa,sb,sc; //sa,sb,sc分别表a,b,c瓶子实际盛水量
int la=10,lb=3,lc=7,sum=10; //la,lb,lc表各瓶子的容量,sum表水的总量。
sa=sum;
sb=0;
sc=0;
while(sc<lc)
{
sc++;
}
cout<<"sa="<<(sa-sc)<<",sb="<<sb<<",sc="<<sc<<"\n";
sa=sa-sc;
do{sb++;}while(sb<lb);
cout<<"sa="<<sa<<",sb="<<sb<<",sc="<<(sc-sb)<<"\n";
sc=sc-sb;
if(sb==lb)
{
sa=sa+sb;
sb=sb-lb;
}
cout<<"sa="<<sa<<",sb="<<sb<<",sc="<<sc<<"\n";
while(sb<lb){sb++;};
cout<<"sa="<<sa<<",sb="<<sb<<",sc="<<(sc-sb)<<"\n";
sc=sc-sb;
if(sb==lb)
{
sa=sa+sb;
sb=sb-lb;
}
cout<<"sa="<<sa<<",sb="<<sb<<",sc="<<sc<<"\n";
if(sb==0)
{
sb=sb+sc;
sc=sc-sc;
}
cout<<"sa="<<sa<<",sb="<<sb<<",sc="<<sc<<"\n";
while(sc<lc)
{sc++;}
sa=sa-sc;
cout<<"sa="<<sa<<",sb="<<sb<<",sc="<<sc<<"\n";
while(sb!=lb)
{
sb++;
sc--;
}
cout<<"sa="<<sa<<",sb="<<sb<<",sc="<<sc<<"\n";
while(sb!=0)
{
sb--;
sa++;
}
cout<<"sa="<<sa<<",sb="<<sb<<",sc="<<sc<<"\n";
}