Sponsored Content
Top Forums Programming i need help regarding this in java Post 302511995 by vishnulinux on Friday 8th of April 2011 05:45:15 AM
Old 04-08-2011
// See If this works only modified your code a bit
//package org.hello.test;


import java.lang.String;
import java.util.Formatter;

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author vaibhav
*/
import java.lang.String;

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author vaibhav
*/
public class Test {
private static String str;
public static void main(String args[])
{
str="123456789";
for(int lim=0;lim<9;lim++)
{
for(int start=1;start<=(9-lim);start++)
{
// print start number of spaces
int j=0;
while(j<start){
System.out.print(" "); j++;}
//print start-lim number of spaces
for( j=0;j<9-lim-1;j++)
System.out.print(" ");
// now print values from string string
for(int i=start;i<=lim+start;i++)
{
System.out.print(str.charAt(i-1));
}


//System.out.print("\t");
}
System.out.println("");
}
StringBuilder sb = new StringBuilder();
//Formatter formatter = new Formatter(sb, Locale.US);
//formatter.format("%4$2s %3$2s %2$2s %1$2s", "a", "b", "c", "d")

}

}
 
__gnu_pbds::trie_string_access_traits< String, Min_E_V__gnu_pbds::trie_string_access_traits< String, Min_E_Val, Max_E_Val, Reverse, _Alloc >(3cxx)

NAME
__gnu_pbds::trie_string_access_traits< String, Min_E_Val, Max_E_Val, Reverse, _Alloc > - SYNOPSIS
Public Types enum { reverse } enum { min_e_val, max_e_val, max_size } typedef _Alloc::template rebind< key_type > __rebind_k" typedef detail::__conditional_type < Reverse, typename String::const_reverse_iterator, typename String::const_iterator > ::__type const_iterator" typedef std::iterator_traits < const_iterator >::value_type e_type" typedef __rebind_k::other::const_reference key_const_reference" typedef String key_type typedef _Alloc::size_type size_type Static Public Member Functions static const_iterator begin (key_const_reference) static size_type e_pos (e_type e) static const_iterator end (key_const_reference) Detailed Description template<typename String = std::string, typename String::value_type Min_E_Val = detail::__numeric_traits<typename String::value_type>::__min, typename String::value_type Max_E_Val = detail::__numeric_traits<typename String::value_type>::__max, bool Reverse = false, typename _Alloc = std::allocator<char>>struct __gnu_pbds::trie_string_access_traits< String, Min_E_Val, Max_E_Val, Reverse, _Alloc > Element access traits for string types. Template Parameters: String String type. Min_E_Val Minimal element value. Max_E_Val Maximum element value. Reverse Reverse iteration should be used. Default: false. _Alloc Allocator type. Definition at line 75 of file trie_policy.hpp. Member Typedef Documentation template<typename String = std::string, typename String::value_type Min_E_Val = detail::__numeric_traits<typename String::value_type>::__min, typename String::value_type Max_E_Val = detail::__numeric_traits<typename String::value_type>::__max, bool Reverse = false, typename _Alloc = std::allocator<char>> typedef detail::__conditional_type<Reverse, typename String::const_reverse_iterator, typename String::const_iterator>::__type __gnu_pbds::trie_string_access_traits< String, Min_E_Val, Max_E_Val, Reverse, _Alloc >::const_iterator Element const iterator type. Definition at line 91 of file trie_policy.hpp. template<typename String = std::string, typename String::value_type Min_E_Val = detail::__numeric_traits<typename String::value_type>::__min, typename String::value_type Max_E_Val = detail::__numeric_traits<typename String::value_type>::__max, bool Reverse = false, typename _Alloc = std::allocator<char>> typedef std::iterator_traits<const_iterator>::value_type __gnu_pbds::trie_string_access_traits< String, Min_E_Val, Max_E_Val, Reverse, _Alloc >::e_type Element type. Definition at line 94 of file trie_policy.hpp. Member Function Documentation template<typename String , typename String::value_type Min_E_Val, typename String::value_type Max_E_Val, bool Reverse, typename _Alloc > trie_string_access_traits< String, Min_E_Val, Max_E_Val, Reverse, _Alloc >::const_iterator __gnu_pbds::trie_string_access_traits< String, Min_E_Val, Max_E_Val, Reverse, _Alloc >::begin (key_const_referencer_key) [inline], [static] Returns a const_iterator to the first element of key_const_reference agumnet. Definition at line 57 of file trie_policy.hpp. template<typename String , typename String::value_type Min_E_Val, typename String::value_type Max_E_Val, bool Reverse, typename _Alloc > trie_string_access_traits< String, Min_E_Val, Max_E_Val, Reverse, _Alloc >::size_type __gnu_pbds::trie_string_access_traits< String, Min_E_Val, Max_E_Val, Reverse, _Alloc >::e_pos (e_typee) [inline], [static] Maps an element to a position. Definition at line 49 of file trie_policy.hpp. template<typename String , typename String::value_type Min_E_Val, typename String::value_type Max_E_Val, bool Reverse, typename _Alloc > trie_string_access_traits< String, Min_E_Val, Max_E_Val, Reverse, _Alloc >::const_iterator __gnu_pbds::trie_string_access_traits< String, Min_E_Val, Max_E_Val, Reverse, _Alloc >::end (key_const_referencer_key) [inline], [static] Returns a const_iterator to the after-last element of key_const_reference argument. Definition at line 65 of file trie_policy.hpp. Author Generated automatically by Doxygen for libstdc++ from the source code. libstdc++ __gnu_pbds::trie_string_access_traits< String, Min_E_Val, Max_E_Val, Reverse, _Alloc >(3cxx)
All times are GMT -4. The time now is 03:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy