解题思路:
注意事项:
参考代码:
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
int x,y,a,b,c;
cin>>x;
c=x/4;
y=x%4;
switch(y){
case 0:cout<<0<<" "<<0<<" "<<c<<endl;break;
case 1:cout<<0<<" "<<1<<" "<<c-1<<endl;break;
case 2:cout<<1<<" "<<0<<" "<<c-1<<endl;break;
case 3:cout<<1<<" "<<1<<" "<<c-2<<endl;break;
}
return 0;
}
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
int x,y,a,b,c;
cin>>x;
c=x/4;
y=x%4;
switch(y){
case 0:cout<<0<<" "<<0<<" "<<c<<endl;break;
case 1:cout<<0<<" "<<1<<" "<<c-1<<endl;break;
case 2:cout<<1<<" "<<0<<" "<<c-1<<endl;break;
case 3:cout<<1<<" "<<1<<" "<<c-2<<endl;break;
}
return 0;
}
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
int x,y,a,b,c;
cin>>x;
c=x/4;
y=x%4;
switch(y){
case 0:cout<<0<<" "<<0<<" "<<c<<endl;break;
case 1:cout<<0<<" "<<1<<" "<<c-1<<endl;break;
case 2:cout<<1<<" "<<0<<" "<<c-1<<endl;break;
case 3:cout<<1<<" "<<1<<" "<<c-2<<endl;break;
}
return 0;
}
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
int x,y,a,b,c;
cin>>x;
c=x/4;
y=x%4;
switch(y){
case 0:cout<<0<<" "<<0<<" "<<c<<endl;break;
case 1:cout<<0<<" "<<1<<" "<<c-1<<endl;break;
case 2:cout<<1<<" "<<0<<" "<<c-1<<endl;break;
case 3:cout<<1<<" "<<1<<" "<<c-2<<endl;break;
}
return 0;
}
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
int x,y,a,b,c;
cin>>x;
c=x/4;
y=x%4;
switch(y){
case 0:cout<<0<<" "<<0<<" "<<c<<endl;break;
case 1:cout<<0<<" "<<1<<" "<<c-1<<endl;break;
case 2:cout<<1<<" "<<0<<" "<<c-1<<endl;break;
case 3:cout<<1<<" "<<1<<" "<<c-2<<endl;break;
}
return 0;
}
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
int x,y,a,b,c;
cin>>x;
c=x/4;
y=x%4;
switch(y){
case 0:cout<<0<<" "<<0<<" "<<c<<endl;break;
case 1:cout<<0<<" "<<1<<" "<<c-1<<endl;break;
case 2:cout<<1<<" "<<0<<" "<<c-1<<endl;break;
case 3:cout<<1<<" "<<1<<" "<<c-2<<endl;break;
}
return 0;
}
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
int x,y,a,b,c;
cin>>x;
c=x/4;
y=x%4;
switch(y){
case 0:cout<<0<<" "<<0<<" "<<c<<endl;break;
case 1:cout<<0<<" "<<1<<" "<<c-1<<endl;break;
case 2:cout<<1<<" "<<0<<" "<<c-1<<endl;break;
case 3:cout<<1<<" "<<1<<" "<<c-2<<endl;break;
}
return 0;
}
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
int x,y,a,b,c;
cin>>x;
c=x/4;
y=x%4;
switch(y){
case 0:cout<<0<<" "<<0<<" "<<c<<endl;break;
case 1:cout<<0<<" "<<1<<" "<<c-1<<endl;break;
case 2:cout<<1<<" "<<0<<" "<<c-1<<endl;break;
case 3:cout<<1<<" "<<1<<" "<<c-2<<endl;break;
}
return 0;
}
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
int x,y,a,b,c;
cin>>x;
c=x/4;
y=x%4;
switch(y){
case 0:cout<<0<<" "<<0<<" "<<c<<endl;break;
case 1:cout<<0<<" "<<1<<" "<<c-1<<endl;break;
case 2:cout<<1<<" "<<0<<" "<<c-1<<endl;break;
case 3:cout<<1<<" "<<1<<" "<<c-2<<endl;break;
}
return 0;
}
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
int x,y,a,b,c;
cin>>x;
c=x/4;
y=x%4;
switch(y){
case 0:cout<<0<<" "<<0<<" "<<c<<endl;break;
case 1:cout<<0<<" "<<1<<" "<<c-1<<endl;break;
case 2:cout<<1<<" "<<0<<" "<<c-1<<endl;break;
case 3:cout<<1<<" "<<1<<" "<<c-2<<endl;break;
}
return 0;
}
0.0分
4 人评分
C语言程序设计教程(第三版)课后习题9.1 (Java代码)浏览:481 |
【绝对值排序】 (C语言代码)浏览:832 |
printf基础练习2 (C语言代码)浏览:826 |
C语言程序设计教程(第三版)课后习题6.9 (C语言代码)浏览:1052 |
printf基础练习2 (有点不明白)浏览:887 |
C语言程序设计教程(第三版)课后习题7.2 (C语言代码)浏览:686 |
C语言程序设计教程(第三版)课后习题8.5 (C语言代码)浏览:562 |
a+b浏览:452 |
1054题解浏览:516 |
局部变量作函数返回值的问题浏览:1028 |