fork download
  1. #include <iostream>
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. int t;
  7. cin>>t;
  8. while (t--){
  9. int a,b,c;
  10. cin>>a>>b>>c;
  11. if (a==0 && b==0){
  12. for (int i=0; i<c+1; i++){
  13. cout<<1;
  14. }
  15. cout<<"\n";
  16. }
  17. else{
  18. if (b%2==0) cout<<1;
  19. for (int i=0; i<a+1; i++){
  20. cout<<0;
  21. }
  22. for (int i=0; i<(b-1)/2; i++){
  23. cout<<10;
  24. }
  25. for (int i=0; i<c+1; i++){
  26. cout<<1;
  27. }
  28. cout<<"\n";
  29. }
  30. }
  31. }
Success #stdin #stdout 0s 5320KB
stdin
7
1 3 5
1 1 1
3 9 3
0 1 0
3 1 2
0 0 3
2 0 0
stdout
0010111111
0011
0000101010101111
01
0000111
1111
10001